diff options
Diffstat (limited to 'src/main')
140 files changed, 1893 insertions, 3848 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java index 4b57c09ab8..738d7bfc45 100644 --- a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java +++ b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java @@ -7,7 +7,6 @@ import com.github.technus.tectech.mechanics.data.PlayerDataMessage; import com.github.technus.tectech.mechanics.enderStorage.EnderLinkCoverMessage; import com.github.technus.tectech.mechanics.pipe.PipeActivityMessage; import com.github.technus.tectech.mechanics.spark.RendererMessage; -import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage; public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher { public static NetworkDispatcher INSTANCE; @@ -35,10 +34,5 @@ public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher registerMessage( EnderLinkCoverMessage.ServerUpdateHandler.class, EnderLinkCoverMessage.EnderLinkCoverUpdate.class); registerMessage(EnderLinkCoverMessage.ClientHandler.class, EnderLinkCoverMessage.EnderLinkCoverData.class); - - registerMessage(TextParametersMessage.ServerHandler.class, TextParametersMessage.ParametersTextQuery.class); - registerMessage( - TextParametersMessage.ServerUpdateHandler.class, TextParametersMessage.ParametersTextUpdate.class); - registerMessage(TextParametersMessage.ClientHandler.class, TextParametersMessage.ParametersTextData.class); } } diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java index bdd2dc1136..a2d3edfa5e 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BaseRecipeLoader.java @@ -120,26 +120,6 @@ public class BaseRecipeLoader { OrePrefixes.gem.get(Materials.EnderPearl) }); - // Data reader - GT_ModHandler.addCraftingRecipe( - CustomItemList.Machine_DataReader.get(1), - GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] { - "BdB", - "GES", - "PwP", - 'B', - OrePrefixes.screw.get(Materials.Iridium), - 'P', - OrePrefixes.plate.get(Materials.Iridium), - 'G', - ItemList.Cover_Screen, - 'S', - OrePrefixes.circuit.get(Materials.Elite), - 'E', - ItemList.Hull_IV - }); - // Data Bank RA.addAssemblylineRecipe( ItemList.Hatch_DataAccess_EV.get(1), diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 53a16d2648..436c806da2 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -1042,8 +1042,6 @@ public class MachineLoader implements Runnable { GT_MetaTileEntity_Hatch_Rack.run(); - GT_MetaTileEntity_DataReader.run(); - GT_MetaTileEntity_Hatch_Capacitor.run(); if (!Loader.isModLoaded(Reference.DREAMCRAFT)) { diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index b6d01cb01a..572b3b2c47 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -6,8 +6,6 @@ import static gregtech.api.enums.ItemList.Display_Fluid; import codechicken.lib.gui.GuiDraw; import codechicken.nei.ItemList; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; import codechicken.nei.recipe.*; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -25,7 +23,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; @@ -260,64 +257,6 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { } } - @Deprecated // Unnecessary copy of a class base GT5U uses to manage NEI transfer rects - public static class GT_RectHandler implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - return false; - } - - @Override - public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - public boolean canHandle(GuiContainer gui) { - return false; - } - - @Override - public List<String> handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemDisplayName(GuiContainer gui, ItemStack itemstack, List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip( - GuiContainer gui, ItemStack itemstack, int mousex, int mousey, List<String> currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - @Override - public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) {} - - @Override - public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) {} - - @Override - public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) {} - - @Override - public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) {} - - @Override - public void onMouseDragged(GuiContainer gui, int mousex, int mousey, int button, long heldTime) {} - } - public static class FixedPositionedStack extends PositionedStack { public final int mChance; public boolean permutated = false; diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java index 12e6f0d823..15887f0e35 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java @@ -6,8 +6,6 @@ import static gregtech.api.enums.ItemList.Display_Fluid; import codechicken.lib.gui.GuiDraw; import codechicken.nei.ItemList; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; import codechicken.nei.recipe.*; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; @@ -25,7 +23,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; @@ -259,64 +256,6 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { } } - @Deprecated // Unnecessary copy of a class base GT5U uses to manage NEI transfer rects - public static class GT_RectHandler implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) { - return false; - } - - @Override - public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - public boolean canHandle(GuiContainer gui) { - return false; - } - - @Override - public List<String> handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemDisplayName(GuiContainer gui, ItemStack itemstack, List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip( - GuiContainer gui, ItemStack itemstack, int mousex, int mousey, List<String> currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode) { - return false; - } - - @Override - public void onKeyTyped(GuiContainer gui, char keyChar, int keyID) {} - - @Override - public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) {} - - @Override - public void onMouseUp(GuiContainer gui, int mousex, int mousey, int button) {} - - @Override - public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) {} - - @Override - public void onMouseDragged(GuiContainer gui, int mousex, int mousey, int button, long heldTime) {} - } - public static class FixedPositionedStack extends PositionedStack { public final int mChance; public boolean permutated = false; diff --git a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java index ad6bb87c19..e977126595 100644 --- a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java +++ b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java @@ -2,24 +2,25 @@ package com.github.technus.tectech.thing.cover; import static com.github.technus.tectech.mechanics.enderStorage.EnderWorldSavedData.getEnderFluidContainer; import static com.github.technus.tectech.mechanics.enderStorage.EnderWorldSavedData.getEnderLinkTag; -import static gregtech.GT_Mod.gregtechproxy; import com.github.technus.tectech.loader.NetworkDispatcher; import com.github.technus.tectech.mechanics.enderStorage.EnderLinkCoverMessage; import com.github.technus.tectech.mechanics.enderStorage.EnderLinkTag; +import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.api.math.Color; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.common.widget.TextWidget; +import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; import eu.usrv.yamcore.auxiliary.PlayerChatHelper; -import gregtech.api.enums.GT_Values; -import gregtech.api.gui.GT_GUICover; -import gregtech.api.gui.widgets.GT_GuiIcon; -import gregtech.api.gui.widgets.GT_GuiIconButton; -import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; -import gregtech.api.interfaces.IGuiScreen; +import gregtech.api.gui.modularui.GT_CoverUIBuildContext; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; +import gregtech.api.util.ISerializableObject; +import gregtech.common.gui.modularui.widget.CoverDataControllerWidget; +import gregtech.common.gui.modularui.widget.CoverDataFollower_ToggleButtonWidget; import java.util.UUID; -import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; @@ -38,7 +39,7 @@ public class GT_Cover_TM_EnderFluidLink extends GT_CoverBehavior { if (inputTag != null) { tag = inputTag; // Hacky Way to update the gui - GUI_INSTANCE.resetColorField(); + GUI_INSTANCE.resetTextField(); } } @@ -117,131 +118,118 @@ public class GT_Cover_TM_EnderFluidLink extends GT_CoverBehavior { } // region GUI + + private static EnderFluidLinkUIFactory GUI_INSTANCE; + @Override public boolean hasCoverGUI() { return true; } @Override - public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) { + public boolean useModularUI() { + return true; + } + + @Override + public ModularWindow createWindow(GT_CoverUIBuildContext buildContext) { // Only open gui if we're placed on a fluid tank - Object gui = null; - if (aTileEntity instanceof IFluidHandler) { - gui = new TM_EnderFluidLinkCover(aSide, aCoverID, coverData, aTileEntity); + if (buildContext.getTile() instanceof IFluidHandler) { + return new EnderFluidLinkUIFactory(buildContext).createWindow(); } - return gui; + return null; } - private static TM_EnderFluidLinkCover GUI_INSTANCE; - - private class TM_EnderFluidLinkCover extends GT_GUICover { - private final byte side; - private final int coverID; - private int coverVariable; - private GT_GuiTextBox colorField; + private class EnderFluidLinkUIFactory extends UIFactory { private static final int START_X = 10; private static final int START_Y = 25; private static final int SPACE_X = 18; private static final int SPACE_Y = 18; + private static final int PUBLIC_BUTTON_ID = 0; + private static final int PRIVATE_BUTTON_ID = 1; + private static final int IMPORT_BUTTON_ID = 2; + private static final int EXPORT_BUTTON_ID = 3; - private static final int SIZE_X = 176; - private static final int SIZE_Y = 107; - - private static final int BOX_SIZE_X = 34; - private static final int BOX_SIZE_Y = 34; - - private static final int TEXT_FIELD_SIZE_X = SPACE_X * 5 - 8; - private static final int TEXT_FIELD_SIZE_Y = 12; - private static final int TEXT_STRING_LENGTH = 9; - - private static final int FONT_COLOR = 0xFF555555; - private static final int BOX_BORDER_COLOR = 0xFF000000; - - private static final int COLOR_FIELD_ID = 0; - private static final int PUBLIC_BUTTON_ID = 1; - private static final int PRIVATE_BUTTON_ID = 2; - private static final int IMPORT_BUTTON_ID = 3; - private static final int EXPORT_BUTTON_ID = 4; - - private GT_GuiIconButton newButtonWithSpacing(int id, int x, int y, GT_GuiIcon icon) { - return new GT_GuiIconButton(this, id, START_X + SPACE_X * x, START_Y + SPACE_Y * y, icon); - } - - private GT_GuiTextBox newTextField(int id, int x, int y) { - GT_GuiTextBox field = new GT_GuiTextBox( - this, id, START_X + SPACE_X * x, START_Y + SPACE_Y * y, TEXT_FIELD_SIZE_X, TEXT_FIELD_SIZE_Y); - field.setMaxStringLength(TEXT_STRING_LENGTH); - return field; - } + private TextFieldWidget frequencyField; - private int drawNewString(String text, int x, int y) { - int align = 4; - return fontRendererObj.drawString(text, START_X + SPACE_X * x, align + START_Y + SPACE_Y * y, FONT_COLOR); - } - - public TM_EnderFluidLinkCover(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - super(aTileEntity, SIZE_X, SIZE_Y, GT_Utility.intToStack(aCoverID)); - side = aSide; - coverID = aCoverID; - coverVariable = aCoverVariable; - NetworkDispatcher.INSTANCE.sendToServer( - new EnderLinkCoverMessage.EnderLinkCoverQuery(tag, (IFluidHandler) tile)); - // Color Value Field - colorField = newTextField(COLOR_FIELD_ID, 0, 0); - GUI_INSTANCE = this; - resetColorField(); - // Public/Private Buttons - newButtonWithSpacing(PUBLIC_BUTTON_ID, 0, 2, GT_GuiIcon.WHITELIST).setTooltipText(trans("326", "Public")); - newButtonWithSpacing(PRIVATE_BUTTON_ID, 1, 2, GT_GuiIcon.BLACKLIST).setTooltipText(trans("327", "Private")); - // Import/Export Buttons - newButtonWithSpacing(IMPORT_BUTTON_ID, 0, 3, GT_GuiIcon.IMPORT).setTooltipText(trans("007", "Import")); - newButtonWithSpacing(EXPORT_BUTTON_ID, 1, 3, GT_GuiIcon.EXPORT).setTooltipText(trans("006", "Export")); + public EnderFluidLinkUIFactory(GT_CoverUIBuildContext buildContext) { + super(buildContext); } + @SuppressWarnings("PointlessArithmeticExpression") @Override - public void drawExtras(int mouseX, int mouseY, float parTicks) { - super.drawExtras(mouseX, mouseY, parTicks); - drawNewString(trans("328", "Channel"), 5, 0); - drawNewString(trans("329", "Public/Private"), 2, 2); - drawNewString(trans("229", "Import/Export"), 2, 3); - } - - @Override - protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { - updateButtons(); - } - - @Override - public void buttonClicked(GuiButton btn) { - if (getClickable(btn.id)) { - coverVariable = getNewCoverVariable(btn.id); - GT_Values.NW.sendToServer(new GT_Packet_TileEntityCover(side, coverID, coverVariable, tile)); - } - updateButtons(); - } - - private void updateButtons() { - GuiButton b; - for (Object o : buttonList) { - b = (GuiButton) o; - b.enabled = getClickable(b.id); - } - } - - private void switchPrivatePublic(int coverVar) { - UUID ownerUUID = tag.getUUID(); - if (testBit(coverVar, PUBLIC_PRIVATE_MASK)) { - ownerUUID = gregtechproxy.getThePlayer().getUniqueID(); - } else { - ownerUUID = null; - } - EnderLinkTag newTag = new EnderLinkTag(tag.getFrequency(), ownerUUID); - NetworkDispatcher.INSTANCE.sendToServer( - new EnderLinkCoverMessage.EnderLinkCoverUpdate(newTag, (IFluidHandler) tile)); + protected void addUIWidgets(ModularWindow.Builder builder) { + NetworkDispatcher.INSTANCE.sendToServer(new EnderLinkCoverMessage.EnderLinkCoverQuery( + tag, (IFluidHandler) getUIBuildContext().getTile())); + GUI_INSTANCE = this; + frequencyField = new TextFieldWidget() { + @Override + public void onRemoveFocus() { + super.onRemoveFocus(); + try { + String string = getText(); + tag = new EnderLinkTag(string, tag.getUUID()); + NetworkDispatcher.INSTANCE.sendToServer(new EnderLinkCoverMessage.EnderLinkCoverUpdate( + tag, (IFluidHandler) getUIBuildContext().getTile())); + } catch (NumberFormatException ignored) { + } + resetTextField(); + } + }; + + builder.widget(frequencyField + .setTextColor(Color.WHITE.dark(1)) + .setTextAlignment(Alignment.CenterLeft) + .setFocusOnGuiOpen(true) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) + .setPos(START_X + SPACE_X * 0, START_Y + SPACE_Y * 0) + .setSize(SPACE_X * 5 - 8, 12)) + .widget(new CoverDataControllerWidget.CoverDataIndexedControllerWidget_ToggleButtons<>( + this::getCoverData, + this::setCoverData, + GT_Cover_TM_EnderFluidLink.this, + (id, coverData) -> !getClickable(id, convert(coverData)), + (id, coverData) -> new ISerializableObject.LegacyCoverData( + getNewCoverVariable(id, convert(coverData)))) + .addToggleButton( + PUBLIC_BUTTON_ID, + CoverDataFollower_ToggleButtonWidget.ofDisableable(), + widget -> widget.setStaticTexture(GT_UITextures.OVERLAY_BUTTON_WHITELIST) + .addTooltip(GT_Utility.trans("326", "Public")) + .setPos(START_X + SPACE_X * 0, START_Y + SPACE_Y * 2)) + .addToggleButton( + PRIVATE_BUTTON_ID, + CoverDataFollower_ToggleButtonWidget.ofDisableable(), + widget -> widget.setStaticTexture(GT_UITextures.OVERLAY_BUTTON_BLACKLIST) + .addTooltip(GT_Utility.trans("327", "Private")) + .setPos(START_X + SPACE_X * 1, START_Y + SPACE_Y * 2)) + .addToggleButton( + IMPORT_BUTTON_ID, + CoverDataFollower_ToggleButtonWidget.ofDisableable(), + widget -> widget.setStaticTexture(GT_UITextures.OVERLAY_BUTTON_IMPORT) + .addTooltip(GT_Utility.trans("007", "Import")) + .setPos(START_X + SPACE_X * 0, START_Y + SPACE_Y * 3)) + .addToggleButton( + EXPORT_BUTTON_ID, + CoverDataFollower_ToggleButtonWidget.ofDisableable(), + widget -> widget.setStaticTexture(GT_UITextures.OVERLAY_BUTTON_EXPORT) + .addTooltip(GT_Utility.trans("006", "Export")) + .setPos(START_X + SPACE_X * 1, START_Y + SPACE_Y * 3))) + .widget(new TextWidget(GT_Utility.trans("328", "Channel")) + .setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(START_X + SPACE_X * 5, 4 + START_Y + SPACE_Y * 0)) + .widget(new TextWidget(GT_Utility.trans("329", "Public/Private")) + .setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(START_X + SPACE_X * 2, 4 + START_Y + SPACE_Y * 2)) + .widget(new TextWidget(GT_Utility.trans("229", "Import/Export")) + .setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(START_X + SPACE_X * 2, 4 + START_Y + SPACE_Y * 3)); + + resetTextField(); } - private int getNewCoverVariable(int id) { + private int getNewCoverVariable(int id, int coverVariable) { int tempCoverVariable = coverVariable; switch (id) { case PUBLIC_BUTTON_ID: @@ -256,7 +244,7 @@ public class GT_Cover_TM_EnderFluidLink extends GT_CoverBehavior { return tempCoverVariable; } - private boolean getClickable(int id) { + private boolean getClickable(int id, int coverVariable) { boolean canBeClicked = false; switch (id) { case PUBLIC_BUTTON_ID: @@ -274,36 +262,20 @@ public class GT_Cover_TM_EnderFluidLink extends GT_CoverBehavior { return canBeClicked; } - @Override - public void applyTextBox(GT_GuiIntegerTextBox box) { - try { - String string = box.getText(); - tag = new EnderLinkTag(string, tag.getUUID()); - NetworkDispatcher.INSTANCE.sendToServer( - new EnderLinkCoverMessage.EnderLinkCoverUpdate(tag, (IFluidHandler) tile)); - } catch (NumberFormatException ignored) { - } - resetColorField(); + private void resetTextField() { + frequencyField.setText(tag.getFrequency()); } - @Override - public void resetTextBox(GT_GuiIntegerTextBox box) { - box.setText(tag.getFrequency()); - } - - public void resetColorField() { - resetTextBox(colorField); - } - - private class GT_GuiTextBox extends GT_GuiIntegerTextBox { - public GT_GuiTextBox(IGuiScreen gui, int id, int x, int y, int width, int height) { - super(gui, id, x, y, width, height); - } - - @Override - public boolean validChar(char c, int key) { - return true; + private void switchPrivatePublic(int coverVar) { + UUID ownerUUID; + if (testBit(coverVar, PUBLIC_PRIVATE_MASK)) { + ownerUUID = getUIBuildContext().getPlayer().getUniqueID(); + } else { + ownerUUID = null; } + EnderLinkTag newTag = new EnderLinkTag(tag.getFrequency(), ownerUUID); + NetworkDispatcher.INSTANCE.sendToServer(new EnderLinkCoverMessage.EnderLinkCoverUpdate( + newTag, (IFluidHandler) getUIBuildContext().getTile())); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java new file mode 100644 index 0000000000..14ef35b317 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java @@ -0,0 +1,109 @@ +package com.github.technus.tectech.thing.gui; + +import static com.github.technus.tectech.Reference.MODID; + +import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture; +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +public class TecTechUITextures { + + public static final AdaptableUITexture BACKGROUND_SCREEN_BLUE = + AdaptableUITexture.of(MODID, "gui/background/screen_blue", 90, 72, 2); + public static final UITexture BACKGROUND_SCREEN_BLUE_PARAMETRIZER_TXT = + UITexture.fullImage(MODID, "gui/background/screen_blue_parametrizer_txt"); + + public static final UITexture BUTTON_STANDARD_16x16 = UITexture.fullImage(MODID, "gui/button/standard_16x16"); + public static final UITexture BUTTON_STANDARD_LIGHT_16x16 = + UITexture.fullImage(MODID, "gui/button/standard_light_16x16"); + + public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_DISABLED = + UITexture.fullImage(MODID, "gui/overlay_button/power_switch_disabled"); + public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_OFF = + UITexture.fullImage(MODID, "gui/overlay_button/power_switch_off"); + public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_ON = + UITexture.fullImage(MODID, "gui/overlay_button/power_switch_on"); + public static final UITexture OVERLAY_BUTTON_HEAT_OFF = UITexture.fullImage(MODID, "gui/overlay_button/heat_off"); + public static final UITexture OVERLAY_BUTTON_HEAT_ON = UITexture.fullImage(MODID, "gui/overlay_button/heat_on"); + public static final UITexture[] OVERLAY_BUTTON_UNCERTAINTY = IntStream.range(0, 16) + .mapToObj(i -> UITexture.fullImage(MODID, "gui/overlay_button/uncertainty/" + i)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture OVERLAY_BUTTON_SAFE_VOID_DISABLED = + UITexture.fullImage(MODID, "gui/overlay_button/safe_void_disabled"); + public static final UITexture OVERLAY_BUTTON_SAFE_VOID_OFF = + UITexture.fullImage(MODID, "gui/overlay_button/safe_void_off"); + public static final UITexture OVERLAY_BUTTON_SAFE_VOID_ON = + UITexture.fullImage(MODID, "gui/overlay_button/safe_void_on"); + public static final UITexture OVERLAY_BUTTON_POWER_PASS_DISABLED = + UITexture.fullImage(MODID, "gui/overlay_button/power_pass_disabled"); + public static final UITexture OVERLAY_BUTTON_POWER_PASS_OFF = + UITexture.fullImage(MODID, "gui/overlay_button/power_pass_off"); + public static final UITexture OVERLAY_BUTTON_POWER_PASS_ON = + UITexture.fullImage(MODID, "gui/overlay_button/power_pass_on"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_ID = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_id"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_0 = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_0"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_1 = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_1"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_X = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_x"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_S = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_s"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_T = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_t"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_C = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_c"); + public static final UITexture OVERLAY_BUTTON_PARAMETRIZER_IF = + UITexture.fullImage(MODID, "gui/overlay_button/parametrizer_if"); + + public static final UITexture OVERLAY_SLOT_RACK = UITexture.fullImage(MODID, "gui/overlay_slot/rack"); + public static final UITexture OVERLAY_SLOT_MESH = UITexture.fullImage(MODID, "gui/overlay_slot/mesh"); + + public static final UITexture PICTURE_TECTECH_LOGO = UITexture.fullImage(MODID, "gui/picture/tectech_logo"); + public static final UITexture PICTURE_TECTECH_LOGO_DARK = + UITexture.fullImage(MODID, "gui/picture/tectech_logo_dark"); + public static final UITexture PICTURE_RACK_LARGE = UITexture.fullImage(MODID, "gui/picture/rack_large"); + public static final UITexture PICTURE_HEAT_SINK = UITexture.fullImage(MODID, "gui/picture/heat_sink"); + public static final UITexture PICTURE_UNCERTAINTY_MONITOR = + UITexture.fullImage(MODID, "gui/picture/uncertainty/monitor"); + public static final UITexture PICTURE_UNCERTAINTY_INDICATOR = + UITexture.fullImage(MODID, "gui/picture/uncertainty/indicator"); + public static final UITexture PICTURE_UNCERTAINTY_SELECTED = + UITexture.fullImage(MODID, "gui/picture/uncertainty/selected"); + public static final UITexture[] PICTURE_UNCERTAINTY_VALID = IntStream.range(0, 9) + .mapToObj(i -> UITexture.fullImage(MODID, "gui/picture/uncertainty/valid_" + i)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_UNCERTAINTY_INVALID = IntStream.range(0, 9) + .mapToObj(i -> UITexture.fullImage(MODID, "gui/picture/uncertainty/invalid_" + i)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture PICTURE_HEAT_SINK_SMALL = UITexture.fullImage(MODID, "gui/picture/heat_sink_small"); + public static final UITexture PICTURE_PARAMETER_BLANK = UITexture.fullImage(MODID, "gui/picture/parameter_blank"); + public static final UITexture[] PICTURE_PARAMETER_BLUE = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_blue", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_PARAMETER_CYAN = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_cyan", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_PARAMETER_GREEN = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_green", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_PARAMETER_ORANGE = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_orange", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture[] PICTURE_PARAMETER_RED = IntStream.range(0, 20) + .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_red", 158, 4, i * 8, 0, i * 8 + 6, 4)) + .collect(Collectors.toList()) + .toArray(new UITexture[0]); + public static final UITexture PICTURE_PARAMETER_GRAY = UITexture.fullImage(MODID, "gui/picture/parameter_gray"); + public static final UITexture PICTURE_UNCERTAINTY_MONITOR_MULTIMACHINE = + UITexture.fullImage(MODID, "gui/picture/uncertainty/monitor_multimachine"); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java index 1be2282efc..041e60eefe 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java @@ -7,14 +7,18 @@ import static net.minecraft.util.StatCollector.translateToLocal; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Capacitor; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Capacitor; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.SlotGroup; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; @@ -23,14 +27,13 @@ import java.util.HashMap; import java.util.Map; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; /** * Created by Tec on 03.04.2017. */ -public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch implements IAddUIWidgets { private static Textures.BlockIcons.CustomIcon TM_H; private static Textures.BlockIcons.CustomIcon TM_H_ACTIVE; private static Map<String, GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent> componentBinds = new HashMap<>(); @@ -103,24 +106,8 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Capacitor(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Capacitor( - aPlayerInventory, - aBaseMetaTileEntity, - translateToLocal("gt.blockmachines.hatch.capacitor.tier.03.name")); // Capacitor Hatch - } - - @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -175,6 +162,32 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { return new long[] {tier, tCurrent, tEnergyMax}; } + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 4) + .startFromSlot(0) + .endAtSlot(15) + .slotCreator(index -> new BaseSlot(inventoryHandler, index) { + @Override + public int getSlotStackLimit() { + return 1; + } + + @Override + public boolean isEnabled() { + return !getBaseMetaTileEntity().isActive(); + } + }) + .background(getGUITextureSet().getItemSlot()) + .build() + .setPos(52, 7)); + } + public static void run() { new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent( Reference.MODID + ":item.tm.teslaCoilCapacitor.0", 0, 1, V[1] * 512); // LV Capacitor diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java index 854a0321bf..5e946e2223 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java @@ -13,7 +13,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -72,13 +72,9 @@ public class GT_MetaTileEntity_Hatch_CreativeMaintenance extends GT_MetaTileEnti } @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; + public boolean onRightclick( + IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + return false; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index de173f2a16..af6197be39 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -2,28 +2,34 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import static net.minecraft.util.StatCollector.translateToLocal; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Holder; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Holder; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; /** * Created by Tec on 03.04.2017. */ -public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo { private static Textures.BlockIcons.CustomIcon EM_H; private static Textures.BlockIcons.CustomIcon EM_H_ACTIVE; @@ -90,19 +96,6 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Holder(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Holder( - aPlayerInventory, - aBaseMetaTileEntity, - translateToLocal("gt.blockmachines.hatch.holder.tier.09.name")); // Object Holder - } - - @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { return true; @@ -112,7 +105,7 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { // else if(heat>0) // aPlayer.addChatComponentMessage(new ChatComponentText("It is still warm...")); // else - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -130,4 +123,54 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { + translateToLocal("gt.blockmachines.hatch.holder.desc.1") // Advanced Holding Mechanism! }; } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO) + .setSize(18, 18) + .setPos(151, 63)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_HEAT_SINK) + .setPos(46, 17) + .setSize(84, 60)) + .widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_RACK_LARGE) + .setPos(68, 27) + .setSize(40, 40)) + .widget(new SlotWidget(new BaseSlot(inventoryHandler, 0) { + @Override + public int getSlotStackLimit() { + return 1; + } + + @Override + public boolean isEnabled() { + return !getBaseMetaTileEntity().isActive(); + } + }) + .setPos(79, 38)) + .widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BUTTON_STANDARD_LIGHT_16x16) + .setPos(152, 24) + .setSize(16, 16)) + .widget(new DrawableWidget() + .setDrawable(() -> getBaseMetaTileEntity().isActive() + ? TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON + : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_DISABLED) + .setPos(152, 24) + .setSize(16, 16)) + .widget(new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java index c61d9d157e..ce0215f2c9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputDataItems.java @@ -20,7 +20,6 @@ import gregtech.api.objects.GT_RenderedTexture; import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -90,21 +89,10 @@ public class GT_MetaTileEntity_Hatch_InputDataItems extends GT_MetaTileEntity_Ha } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); return true; } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java index 197006510d..323973acbb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java @@ -12,8 +12,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -46,27 +44,6 @@ public class GT_MetaTileEntity_Hatch_OutputDataItems } @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } else { - super.onRightclick(aBaseMetaTileEntity, aPlayer); - aBaseMetaTileEntity.openGUI(aPlayer); - return true; - } - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java index ed6e00dccf..7a59e39c6d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java @@ -3,24 +3,35 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Param; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamAdv; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Param; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamAdv; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -30,7 +41,7 @@ import org.apache.commons.lang3.reflect.FieldUtils; /** * Created by danie_000 on 15.12.2016. */ -public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo, IAddUIWidgets { public int pointer = 0; public int param = -1; public double value0D = 0; @@ -60,22 +71,6 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier > 5) { // TODO update mTier to 4 after recipe check - return new GT_Container_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); - } - return new GT_Container_Param(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier > 5) { // TODO update mTier to 4 after recipe check - return new GT_GUIContainer_ParamAdv(aPlayerInventory, aBaseMetaTileEntity); - } - return new GT_GUIContainer_Param(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return new ITexture[] {aBaseTexture, new GT_RenderedTexture(ScreenON)}; } @@ -214,7 +209,7 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -227,4 +222,396 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { + translateToLocal("gt.blockmachines.hatch.param.desc.1") + "\u00b2" // E=mine*craft }; } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO_DARK) + .setSize(18, 18) + .setPos(112, 55)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + final boolean isAdvanced = mTier > 5; + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(43, 4) + .setSize(90, 72)); + + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> param -= shift ? 16 : 4, + 7, + 4, + GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + secondRow.set(false); + } else { + columnPointer.addAndGet(shift ? -16 : -4); + } + } else { + value0D -= shift ? 4096 : 256; + } + }, + 7, + 22, + GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_0); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + columnPointer.addAndGet(shift ? -16 : -4); + } else { + secondRow.set(true); + } + } else { + value1D -= shift ? 4096 : 256; + } + }, + 7, + 40, + GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_1); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (shift) { + if (secondRow.get()) { + value1D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); + } else { + value0D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); + } + } else { + if (secondRow.get()) { + long temp = Double.doubleToLongBits(value1D); + temp |= 1L << (long) columnPointer.get(); + value1D = Double.longBitsToDouble(temp); + } else { + long temp = Double.doubleToLongBits(value0D); + temp |= 1L << (long) columnPointer.get(); + value0D = Double.longBitsToDouble(temp); + } + } + } else { + value0D /= shift ? 4096 : 256; + value1D /= shift ? 4096 : 256; + } + }, + 7, + 58, + isAdvanced ? TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_S : GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + isAdvanced ? null : TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> param -= shift ? 2 : 1, + 25, + 4, + GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + secondRow.set(false); + } else { + columnPointer.addAndGet(shift ? -2 : -1); + } + } else { + value0D -= shift ? 16 : 1; + } + }, + 25, + 22, + GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_0); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + columnPointer.addAndGet(shift ? -2 : -1); + } else { + secondRow.set(true); + } + } else { + value1D -= shift ? 16 : 1; + } + }, + 25, + 40, + GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_1); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (shift) { + if (secondRow.get()) { + value1D = Double.longBitsToDouble(0); + } else { + value0D = Double.longBitsToDouble(0); + } + } else { + if (secondRow.get()) { + long temp = Double.doubleToLongBits(value1D); + temp &= ~(1L << (long) columnPointer.get()); + value1D = Double.longBitsToDouble(temp); + } else { + long temp = Double.doubleToLongBits(value0D); + temp &= ~(1L << (long) columnPointer.get()); + value0D = Double.longBitsToDouble(temp); + } + } + } else { + value0D /= shift ? 16 : 2; + value1D /= shift ? 16 : 2; + } + }, + 25, + 58, + isAdvanced ? TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_C : GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + isAdvanced ? null : TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_X); + + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> param += shift ? 2 : 1, + 133, + 4, + GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + secondRow.set(false); + } else { + columnPointer.addAndGet(shift ? 2 : 1); + } + } else { + value0D += shift ? 16 : 1; + } + }, + 133, + 22, + GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_0); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + columnPointer.addAndGet(shift ? 2 : 1); + } else { + secondRow.set(true); + } + } else { + value1D += shift ? 16 : 1; + } + }, + 133, + 40, + GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_1); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (shift) { + if (secondRow.get()) { + value1D = Double.longBitsToDouble(~Double.doubleToLongBits(value1D)); + } else { + value0D = Double.longBitsToDouble(~Double.doubleToLongBits(value1D)); + } + } else { + if (secondRow.get()) { + long temp = Double.doubleToLongBits(value1D); + temp ^= 1L << (long) columnPointer.get(); + value1D = Double.longBitsToDouble(temp); + } else { + long temp = Double.doubleToLongBits(value0D); + temp ^= 1L << (long) columnPointer.get(); + value0D = Double.longBitsToDouble(temp); + } + } + } else { + value0D *= shift ? 16 : 2; + value1D *= shift ? 16 : 2; + } + }, + 133, + 58, + isAdvanced ? TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_T : GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, + isAdvanced ? null : TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> param += shift ? 16 : 4, + 151, + 4, + GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + secondRow.set(false); + } else { + columnPointer.addAndGet(shift ? 16 : 4); + } + } else { + value0D += shift ? 4096 : 256; + } + }, + 151, + 22, + GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_0); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + if (secondRow.get()) { + columnPointer.addAndGet(shift ? 16 : 4); + } else { + secondRow.set(true); + } + } else { + value1D += shift ? 4096 : 256; + } + }, + 151, + 40, + GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, + TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_1); + addChangeParamButton( + builder, + (shift, columnPointer, secondRow) -> { + if (isAdvanced) { + value0D = input0D; + value1D = input1D; + } else { + value0D *= shift ? 4096 : 256; + value1D *= shift ? 4096 : 256; + } + }, + 151, + 58, + isAdvanced ? TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_IF : GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, + isAdvanced ? null : TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID); + + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> pointer, val -> pointer = val)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> param, val -> param = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> value0D, val -> value0D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> value1D, val -> value1D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> input0D, val -> input0D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> input1D, val -> input1D = val)); + + final String CIRCLED_0 = "\u24EA"; + final String CIRCLED_1 = "\u2460"; + final String ARROW_DOWN = "\u2b07"; + final String ARROW_UP = "\u2b06"; + builder.widget(TextWidget.dynamicString(() -> (isAdvanced ? "Parameters X: " : "Parameters: ") + param) + .setSynced(false) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 7)) + .widget(TextWidget.dynamicString(() -> CIRCLED_0 + ARROW_DOWN + TT_Utility.formatNumberExp(input0D)) + .setSynced(false) + .setDefaultColor(0x22ddff) + .setPos(46, 16)) + .widget(TextWidget.dynamicString(() -> CIRCLED_1 + ARROW_DOWN + TT_Utility.formatNumberExp(input1D)) + .setSynced(false) + .setDefaultColor(0x00ffff) + .setPos(46, 24)) + .widget(TextWidget.dynamicString(() -> CIRCLED_0 + ARROW_UP + TT_Utility.formatNumberExp(value0D)) + .setSynced(false) + .setDefaultColor(0x00bbff) + .setPos(46, 33)) + .widget(TextWidget.dynamicString(() -> CIRCLED_1 + ARROW_UP + TT_Utility.formatNumberExp(value1D)) + .setSynced(false) + .setDefaultColor(0x0077ff) + .setPos(46, 41)) + .widget(TextWidget.dynamicString(() -> CIRCLED_0 + + ARROW_UP + + TT_Utility.longBitsToShortString(Double.doubleToLongBits(value0D))) + .setSynced(false) + .setDefaultColor(0x00bbff) + .setScale(.5f) + .setTextAlignment(Alignment.CenterLeft) + .setPos(46, 50)) + .widget(TextWidget.dynamicString(() -> CIRCLED_1 + + ARROW_UP + + TT_Utility.longBitsToShortString(Double.doubleToLongBits(value1D))) + .setSynced(false) + .setDefaultColor(0x0077ff) + .setScale(.5f) + .setTextAlignment(Alignment.CenterLeft) + .setPos(46, 58)); + if (isAdvanced) { + builder.widget(TextWidget.dynamicString(() -> + "Pointer " + Integer.toHexString(pointer | 0x10000).substring(1)) + .setSynced(false) + .setDefaultColor(0x0033ff) + .setPos(46, 66)); + } + } + + private void addChangeParamButton( + ModularWindow.Builder builder, + OnClick onClick, + int xPos, + int yPos, + IDrawable overlay1, + IDrawable overlay2) { + final boolean isAdvanced = mTier > 5; + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + AtomicInteger columnPointer = new AtomicInteger(pointer & 0xff); + AtomicBoolean secondRow = new AtomicBoolean((pointer & 0x0100) != 0); + onClick.accept(clickData.shift, columnPointer, secondRow); + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (isAdvanced) { + if (columnPointer.get() >= 64) { + columnPointer.set(63); + } else if (columnPointer.get() < 0) { + columnPointer.set(0); + } + pointer = secondRow.get() ? columnPointer.get() + 0x100 : columnPointer.get(); + } + if (param > 9) { + param = 9; + } else if (param < -1) { + param = -1; + } + }) + .setPlayClickSound(false) + .setBackground( + overlay2 != null + ? new IDrawable[] {GT_UITextures.BUTTON_STANDARD, overlay1, overlay2} + : new IDrawable[] {GT_UITextures.BUTTON_STANDARD, overlay1}) + .setSize(18, 18) + .setPos(xPos, yPos)); + } + + @FunctionalInterface + private interface OnClick { + void accept(boolean shift, AtomicInteger columnPointer, AtomicBoolean secondRow); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java index e241793e0e..810c04d861 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java @@ -3,16 +3,27 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; -import com.github.technus.tectech.loader.NetworkDispatcher; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamText; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; +import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.api.math.Color; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; +import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -36,20 +47,6 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_P super(aName, aTier, aDescription, aTextures); } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (aPlayerInventory.player instanceof EntityPlayerMP) { - NetworkDispatcher.INSTANCE.sendTo( - new TextParametersMessage.ParametersTextData(this), (EntityPlayerMP) aPlayerInventory.player); - } - return new GT_Container_ParamText(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_ParamText(aPlayerInventory, aBaseMetaTileEntity); - } - // @Override // public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { // if (aBaseMetaTileEntity.isClientSide() && (aTick % 20L == 0L)) { @@ -157,7 +154,7 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_P } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -170,4 +167,128 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_P + translateToLocal("gt.blockmachines.hatch.param.desc.1") + "\u00b2" // E=mine*craft }; } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO_DARK) + .setSize(18, 18) + .setPos(148, 55)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE_PARAMETRIZER_TXT) + .setPos(7, 4) + .setSize(162, 72)); + + addChangeNumberButton(builder, -16, -4, 7, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE); + addChangeNumberButton(builder, -2, -1, 25, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL); + addChangeNumberButton(builder, 2, 1, 133, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL); + addChangeNumberButton(builder, 16, 4, 151, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE); + + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> param, val -> param = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> value0D, val -> value0D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> value1D, val -> value1D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> input0D, val -> input0D = val)) + .widget(new FakeSyncWidget.DoubleSyncer(() -> input1D, val -> input1D = val)); + // .widget(new FakeSyncWidget.StringSyncer(() -> value0s, val -> value0s = val)) + // .widget(new FakeSyncWidget.StringSyncer(() -> value1s, val -> value1s = val)); + + final String CIRCLED_0 = "\u24EA"; + final String CIRCLED_1 = "\u2460"; + final String ARROW_DOWN = "\u2b07"; + final String ARROW_UP = "\u2b06"; + builder.widget(TextWidget.dynamicString(() -> "Parameters: " + param) + .setSynced(false) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 7)) + .widget(new TextWidget(CIRCLED_0 + ARROW_UP) + .setDefaultColor(0x00bbff) + .setPos(10, 29)) + .widget(new TextWidget(CIRCLED_1 + ARROW_UP) + .setDefaultColor(0x0077ff) + .setPos(10, 44)) + .widget(TextWidget.dynamicString(() -> CIRCLED_0 + ARROW_DOWN + TT_Utility.formatNumberExp(input0D)) + .setSynced(false) + .setDefaultColor(0x22ddff) + .setPos(10, 56)) + .widget(TextWidget.dynamicString(() -> CIRCLED_1 + ARROW_DOWN + TT_Utility.formatNumberExp(input1D)) + .setSynced(false) + .setDefaultColor(0x00ffff) + .setPos(10, 65)); + + addTextField(builder, true); + addTextField(builder, false); + } + + private void addChangeNumberButton( + ModularWindow.Builder builder, int changeNumberShift, int changeNumber, int xPos, IDrawable overlay) { + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + param += clickData.shift ? changeNumberShift : changeNumber; + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (param > 9) { + param = 9; + } else if (param < -1) { + param = -1; + } + }) + .setPlayClickSound(false) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay, TecTechUITextures.OVERLAY_BUTTON_PARAMETRIZER_ID) + .setSize(18, 18) + .setPos(xPos, 4)); + } + + private void addTextField(ModularWindow.Builder builder, boolean isIndex0) { + TextFieldWidget widget = new TextFieldWidget(); + builder.widget(widget.setGetter(() -> isIndex0 ? value0s : value1s) + .setSetter(str -> { + double val; + try { + val = parse(str); + } catch (Exception e) { + // This shouldn't happen as long as validator works + str = ""; + val = 0; + } + if (isIndex0) { + value0s = str; + value0D = val; + } else { + value1s = str; + value1D = val; + } + }) + .setValidator(str -> { + try { + parse(str); + return str; + } catch (Exception e) { + return widget.getLastText().size() > 0 + ? widget.getLastText().get(0) + : ""; + } + }) + .setTextColor(Color.WHITE.dark(1)) + .setTextAlignment(Alignment.CenterLeft) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD.withOffset(-1, -1, 2, 2)) + .setPos(26, isIndex0 ? 26 : 41) + .setSize(138, 12)); + } + + private double parse(String str) { + double val; + if (str.contains("b")) { + String[] split = str.split("b"); + val = TT_Utility.bitStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); + } else if (str.contains("x")) { + String[] split = str.split("x"); + val = TT_Utility.hexStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); + } else { + val = TT_Utility.stringToDouble(str); + } + return val; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java index 5e3986ec41..b99e030559 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java @@ -8,16 +8,25 @@ import static net.minecraft.util.StatCollector.translateToLocalFormatted; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Rack; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Rack; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; @@ -27,7 +36,6 @@ import java.util.Map; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -36,7 +44,7 @@ import org.apache.commons.lang3.reflect.FieldUtils; /** * Created by Tec on 03.04.2017. */ -public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo, IAddUIWidgets { private static Textures.BlockIcons.CustomIcon EM_R; private static Textures.BlockIcons.CustomIcon EM_R_ACTIVE; public int heat = 0; @@ -130,19 +138,6 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Rack(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Rack( - aPlayerInventory, - aBaseMetaTileEntity, - translateToLocal("gt.blockmachines.hatch.rack.tier.08.name")); // Computer Rack - } - - @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { return true; @@ -158,7 +153,7 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { // else if(heat>0) // aPlayer.addChatComponentMessage(new ChatComponentText("It is still warm...")); // else - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -294,6 +289,71 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { // Heat==1-10? --> 1 } + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO) + .setSize(18, 18) + .setPos(151, 63)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_HEAT_SINK) + .setPos(46, 17) + .setSize(84, 60)); + + Pos2d[] positions = new Pos2d[] { + new Pos2d(68, 27), new Pos2d(90, 27), new Pos2d(68, 49), new Pos2d(90, 49), + }; + for (int i = 0; i < positions.length; i++) { + builder.widget(new SlotWidget(new BaseSlot(inventoryHandler, i) { + @Override + public int getSlotStackLimit() { + return 1; + } + + @Override + public boolean isEnabled() { + return !getBaseMetaTileEntity().isActive() && heat <= 0; + } + }) + .setBackground(getGUITextureSet().getItemSlot(), TecTechUITextures.OVERLAY_SLOT_RACK) + .setPos(positions[i])); + + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BUTTON_STANDARD_LIGHT_16x16) + .setPos(152, 24) + .setSize(16, 16)) + .widget(new DrawableWidget() + .setDrawable(() -> getBaseMetaTileEntity().isActive() + ? TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON + : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_DISABLED) + .setPos(152, 24) + .setSize(16, 16)) + .widget(new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))); + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BUTTON_STANDARD_LIGHT_16x16) + .setPos(152, 41) + .setSize(16, 16)) + .widget(new DrawableWidget() + .setDrawable(() -> heat > 0 + ? TecTechUITextures.OVERLAY_BUTTON_HEAT_ON + : TecTechUITextures.OVERLAY_BUTTON_HEAT_OFF) + .setPos(152, 41) + .setSize(16, 16)) + .widget(new FakeSyncWidget.IntegerSyncer(() -> heat, val -> heat = val)); + } + } + public static void run() { // 20k heat cap max! new RackComponent(ItemList.Circuit_Primitive.get(1), 1, 4, 0, 500, true); // Primitive Circuit new RackComponent(ItemList.Circuit_Basic.get(1), 4, 8, 0, 1000, true); // Basic Circuit diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java index 5c34243742..8dd056155c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Uncertainty.java @@ -2,25 +2,36 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import static net.minecraft.util.StatCollector.translateToLocal; import static net.minecraft.util.StatCollector.translateToLocalFormatted; +import static org.lwjgl.opengl.GL11.*; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Uncertainty; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Uncertainty; -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_UncertaintyAdv; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.GlStateManager; +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -30,7 +41,8 @@ import org.apache.commons.lang3.reflect.FieldUtils; /** * Created by danie_000 on 15.12.2016. */ -public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch { +public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch + implements IAddGregtechLogo, IAddUIWidgets { private static Textures.BlockIcons.CustomIcon ScreenON; private static Textures.BlockIcons.CustomIcon ScreenOFF; public short[] matrix = @@ -59,19 +71,6 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Uncertainty(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - if (mTier > 7) { - return new GT_GUIContainer_UncertaintyAdv(aPlayerInventory, aBaseMetaTileEntity); - } - return new GT_GUIContainer_Uncertainty(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return new ITexture[] {aBaseTexture, new GT_RenderedTexture(ScreenON)}; } @@ -188,7 +187,7 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -333,4 +332,140 @@ public class GT_MetaTileEntity_Hatch_Uncertainty extends GT_MetaTileEntity_Hatch // GT_Utility.sendChatToPlayer(aPlayer, "Equation mode: "+mode); // } // } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO_DARK) + .setSize(18, 18) + .setPos(112, 55)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + final boolean isAdvanced = mTier > 7; + + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(43, 4) + .setSize(90, 72)) + .widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_UNCERTAINTY_MONITOR) + .setPos(46, 27) + .setSize(46, 46)); + + int[] xPositions = new int[] {7, 25, 133, 151}; + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + final int index = i * 4 + j; + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (selection == -1) { + selection = (byte) index; + } else { + short temp = matrix[selection]; + matrix[selection] = matrix[index]; + matrix[index] = temp; + selection = -1; + } + compute(); + }) + .setPlayClickSound(false) + .setBackground( + GT_UITextures.BUTTON_STANDARD, + TecTechUITextures.OVERLAY_BUTTON_UNCERTAINTY[index]) + .setPos(xPositions[i], 4 + j * 18) + .setSize(18, 18)) + .widget(new FakeSyncWidget.ShortSyncer(() -> matrix[index], val -> matrix[index] = val)); + } + } + builder.widget(new FakeSyncWidget.ByteSyncer(() -> selection, val -> selection = val)) + .widget(new FakeSyncWidget.ByteSyncer(() -> mode, val -> mode = val)) + .widget(new FakeSyncWidget.ByteSyncer(() -> status, val -> status = val)); + + builder.widget(TextWidget.dynamicString(() -> "Status: " + (status == 0 ? "OK" : "NG")) + .setSynced(false) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 7)); + + for (int i = 0; i < 9; i++) { + final int index = i; + builder.widget(new DrawableWidget() + .setDrawable(() -> { + UITexture valid = TecTechUITextures.PICTURE_UNCERTAINTY_VALID[index]; + UITexture invalid = TecTechUITextures.PICTURE_UNCERTAINTY_INVALID[index]; + switch (mode) { + case 1: // ooo oxo ooo + if (index == 4) return status == 0 ? valid : invalid; + break; + case 2: // ooo xox ooo + if (index == 3) return (status & 1) == 0 ? valid : invalid; + if (index == 5) return (status & 2) == 0 ? valid : invalid; + break; + case 3: // oxo xox oxo + if (index == 1) return (status & 1) == 0 ? valid : invalid; + if (index == 3) return (status & 2) == 0 ? valid : invalid; + if (index == 5) return (status & 4) == 0 ? valid : invalid; + if (index == 7) return (status & 8) == 0 ? valid : invalid; + break; + case 4: // xox ooo xox + if (index == 0) return (status & 1) == 0 ? valid : invalid; + if (index == 2) return (status & 2) == 0 ? valid : invalid; + if (index == 6) return (status & 4) == 0 ? valid : invalid; + if (index == 8) return (status & 8) == 0 ? valid : invalid; + break; + case 5: // xox oxo xox + if (index == 0) return (status & 1) == 0 ? valid : invalid; + if (index == 2) return (status & 2) == 0 ? valid : invalid; + if (index == 4) return (status & 4) == 0 ? valid : invalid; + if (index == 6) return (status & 8) == 0 ? valid : invalid; + if (index == 8) return (status & 16) == 0 ? valid : invalid; + break; + } + return null; + }) + .setPos(55 + (index % 3) * 12, 36 + (index / 3) * 12) + .setSize(4, 4)); + } + + for (int i = 0; i < 16; i++) { + final int index = i; + builder.widget( + new DrawableWidget() { + @Override + public void draw(float partialTicks) { + if (isAdvanced) { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(1f, 1f, 1f, (float) matrix[index] / 1000f); + + // super.draw but without disabling blend + GlStateManager.pushMatrix(); + getDrawable().draw(Pos2d.ZERO, getSize(), partialTicks); + GlStateManager.popMatrix(); + + glDisable(GL_BLEND); + glColor4f(1f, 1f, 1f, 1f); + } else { + if (TecTech.RANDOM.nextInt(1000) < matrix[index]) { + super.draw(partialTicks); + } + } + } + }.setDrawable(TecTechUITextures.PICTURE_UNCERTAINTY_INDICATOR) + .setPos(47 + (i / 4) * 12, 28 + (i % 4) * 12) + .setSize(8, 8)) + .widget(new DrawableWidget() + .setDrawable( + () -> selection == index ? TecTechUITextures.PICTURE_UNCERTAINTY_SELECTED : null) + .setPos(46 + (i / 4) * 12, 27 + (i % 4) * 12) + .setSize(10, 10)); + } + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java deleted file mode 100644 index 8058c14cf4..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/TextParametersMessage.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch; - -import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.common.network.ByteBufUtils; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import io.netty.buffer.ByteBuf; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; - -public class TextParametersMessage implements IMessage { - int mPosX; - int mPosY; - int mPosZ; - int mPosD; - String mVal0 = ""; - String mVal1 = ""; - - public TextParametersMessage() {} - - @Override - public void fromBytes(ByteBuf pBuffer) { - NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); - mPosX = tTag.getInteger("posx"); - mPosY = tTag.getInteger("posy"); - mPosZ = tTag.getInteger("posz"); - mPosD = tTag.getInteger("posd"); - mVal0 = tTag.getString("value0s"); - mVal1 = tTag.getString("value1s"); - } - - @Override - public void toBytes(ByteBuf pBuffer) { - NBTTagCompound tFXTag = new NBTTagCompound(); - tFXTag.setInteger("posx", mPosX); - tFXTag.setInteger("posy", mPosY); - tFXTag.setInteger("posz", mPosZ); - tFXTag.setInteger("posd", mPosD); - tFXTag.setString("value0s", mVal0); - tFXTag.setString("value1s", mVal1); - ByteBufUtils.writeTag(pBuffer, tFXTag); - } - - public static class ParametersTextQuery extends TextParametersMessage { - public ParametersTextQuery() {} - - public ParametersTextQuery(GT_MetaTileEntity_Hatch_ParamText metaTile) { - IGregTechTileEntity base = metaTile.getBaseMetaTileEntity(); - mPosX = base.getXCoord(); - mPosY = base.getYCoord(); - mPosZ = base.getZCoord(); - mPosD = base.getWorld().provider.dimensionId; - } - } - - public static class ParametersTextData extends TextParametersMessage { - public ParametersTextData() {} - - public ParametersTextData(GT_MetaTileEntity_Hatch_ParamText metaTile) { - IGregTechTileEntity base = metaTile.getBaseMetaTileEntity(); - mPosX = base.getXCoord(); - mPosY = base.getYCoord(); - mPosZ = base.getZCoord(); - mPosD = base.getWorld().provider.dimensionId; - mVal0 = metaTile.value0s; - mVal1 = metaTile.value1s; - } - } - - public static class ParametersTextUpdate extends TextParametersMessage { - public ParametersTextUpdate() {} - - public ParametersTextUpdate(GT_MetaTileEntity_Hatch_ParamText metaTile) { - IGregTechTileEntity base = metaTile.getBaseMetaTileEntity(); - mPosX = base.getXCoord(); - mPosY = base.getYCoord(); - mPosZ = base.getZCoord(); - mPosD = base.getWorld().provider.dimensionId; - mVal0 = metaTile.value0s; - mVal1 = metaTile.value1s; - } - } - - public static class ClientHandler extends AbstractClientMessageHandler<ParametersTextData> { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, ParametersTextData pMessage, MessageContext pCtx) { - if (pPlayer.worldObj.provider.dimensionId == pMessage.mPosD) { - TileEntity te = pPlayer.worldObj.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof GT_MetaTileEntity_Hatch_ParamText) { - ((GT_MetaTileEntity_Hatch_ParamText) meta).value0s = pMessage.mVal0; - ((GT_MetaTileEntity_Hatch_ParamText) meta).value1s = pMessage.mVal1; - if (Minecraft.getMinecraft().currentScreen instanceof GT_GUIContainer_ParamText) { - GT_GUIContainer_ParamText gui = - ((GT_GUIContainer_ParamText) Minecraft.getMinecraft().currentScreen); - if (gui.mContainer == meta) { - gui.setTextIn0(pMessage.mVal0); - gui.setTextIn1(pMessage.mVal1); - } - } - } - } - } - return null; - } - } - - public static class ServerHandler extends AbstractServerMessageHandler<ParametersTextQuery> { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, ParametersTextQuery pMessage, MessageContext pCtx) { - World world = DimensionManager.getWorld(pMessage.mPosD); - if (world != null) { - TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof GT_MetaTileEntity_Hatch_ParamText) { - return new ParametersTextData((GT_MetaTileEntity_Hatch_ParamText) meta); - } - } - } - return null; - } - } - - public static class ServerUpdateHandler extends AbstractServerMessageHandler<ParametersTextUpdate> { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, ParametersTextUpdate pMessage, MessageContext pCtx) { - World world = DimensionManager.getWorld(pMessage.mPosD); - if (world != null) { - TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof GT_MetaTileEntity_Hatch_ParamText) { - ((GT_MetaTileEntity_Hatch_ParamText) meta).value0s = pMessage.mVal0; - ((GT_MetaTileEntity_Hatch_ParamText) meta).value1s = pMessage.mVal1; - ((GT_MetaTileEntity_Hatch_ParamText) meta).value0D = TT_Utility.getValue(pMessage.mVal0); - ((GT_MetaTileEntity_Hatch_ParamText) meta).value1D = TT_Utility.getValue(pMessage.mVal1); - } - } - } - return null; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Capacitor.java deleted file mode 100644 index 378736d334..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Capacitor.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_Capacitor extends GT_ContainerMetaTile_Machine { - public GT_Container_Capacitor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - this.addSlotToContainer(new Slot(this.mTileEntity, 0, 53, 8)); - this.addSlotToContainer(new Slot(this.mTileEntity, 1, 71, 8)); - this.addSlotToContainer(new Slot(this.mTileEntity, 2, 89, 8)); - this.addSlotToContainer(new Slot(this.mTileEntity, 3, 107, 8)); - this.addSlotToContainer(new Slot(this.mTileEntity, 4, 53, 26)); - this.addSlotToContainer(new Slot(this.mTileEntity, 5, 71, 26)); - this.addSlotToContainer(new Slot(this.mTileEntity, 6, 89, 26)); - this.addSlotToContainer(new Slot(this.mTileEntity, 7, 107, 26)); - this.addSlotToContainer(new Slot(this.mTileEntity, 8, 53, 44)); - this.addSlotToContainer(new Slot(this.mTileEntity, 9, 71, 44)); - this.addSlotToContainer(new Slot(this.mTileEntity, 10, 89, 44)); - this.addSlotToContainer(new Slot(this.mTileEntity, 11, 107, 44)); - this.addSlotToContainer(new Slot(this.mTileEntity, 12, 53, 62)); - this.addSlotToContainer(new Slot(this.mTileEntity, 13, 71, 62)); - this.addSlotToContainer(new Slot(this.mTileEntity, 14, 89, 62)); - this.addSlotToContainer(new Slot(this.mTileEntity, 15, 107, 62)); - } - - @Override - public int getSlotCount() { - return 16; - } - - @Override - public int getShiftClickSlotCount() { - return getSlotCount(); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (mActive != 0) { - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { - if (mActive != 0) { - return null; - } - return super.transferStackInSlot(aPlayer, aSlotIndex); - } - - @Override - public boolean canDragIntoSlot(Slot par1Slot) { - if (mActive != 0) { - return false; - } - return super.canDragIntoSlot(par1Slot); - } - - @Override - public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { - if (mActive != 0) { - return; - } - super.putStacksInSlots(par1ArrayOfItemStack); - } - - @Override - protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { - if (mActive != 0) { - return false; - } - return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4); - } - - @Override - public void putStackInSlot(int par1, ItemStack par2ItemStack) { - if (mActive != 0) { - return; - } - super.putStackInSlot(par1, par2ItemStack); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java deleted file mode 100644 index e8377ba7bb..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -/** - * Created by Tec on 09.04.2017. - */ -public class GT_Container_Holder extends GT_ContainerMetaTile_Machine { - public GT_Container_Holder(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(mTileEntity, 0, 80, 39)); - } - - @Override - public int getSlotCount() { - return 1; - } - - @Override - public int getShiftClickSlotCount() { - return 1; - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (mActive != 0) { - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { - if (mActive != 0) { - return null; - } - return super.transferStackInSlot(aPlayer, aSlotIndex); - } - - @Override - public boolean canDragIntoSlot(Slot par1Slot) { - if (mActive != 0) { - return false; - } - return super.canDragIntoSlot(par1Slot); - } - - @Override - public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { - if (mActive != 0) { - return; - } - super.putStacksInSlots(par1ArrayOfItemStack); - } - - @Override - protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { - if (mActive != 0) { - return false; - } - return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4); - } - - @Override - public void putStackInSlot(int par1, ItemStack par2ItemStack) { - if (mActive != 0) { - return; - } - super.putStackInSlot(par1, par2ItemStack); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java deleted file mode 100644 index f5e0ffd45d..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_Param extends GT_ContainerMetaTile_Machine { - public int param = 0; - public double value0d = 0; - public double value1d = 0; - public double input0d = 0; - public double input1d = 0; - public long value0l = 0; - public long value1l = 0; - public long input0l = 0; - public long input1l = 0; - - public GT_Container_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - boolean doStuff = true; - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_Hatch_Param paramH = (GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity(); - switch (aSlotIndex) { - case 0: - paramH.param -= aShifthold == 1 ? 16 : 4; - break; - case 1: - paramH.value0D -= aShifthold == 1 ? 4096 : 256; - break; - case 2: - paramH.value1D -= aShifthold == 1 ? 4096 : 256; - break; - case 3: - paramH.value0D /= aShifthold == 1 ? 4096 : 256; - paramH.value1D /= aShifthold == 1 ? 4096 : 256; - break; - case 4: - paramH.param -= aShifthold == 1 ? 2 : 1; - break; - case 5: - paramH.value0D -= aShifthold == 1 ? 16 : 1; - break; - case 6: - paramH.value1D -= aShifthold == 1 ? 16 : 1; - break; - case 7: - paramH.value0D /= aShifthold == 1 ? 16 : 2; - paramH.value1D /= aShifthold == 1 ? 16 : 2; - break; - case 8: - paramH.param += aShifthold == 1 ? 16 : 4; - break; - case 9: - paramH.value0D += aShifthold == 1 ? 4096 : 256; - break; - case 10: - paramH.value1D += aShifthold == 1 ? 4096 : 256; - break; - case 11: - paramH.value0D *= aShifthold == 1 ? 4096 : 256; - paramH.value1D *= aShifthold == 1 ? 4096 : 256; - break; - case 12: - paramH.param += aShifthold == 1 ? 2 : 1; - break; - case 13: - paramH.value0D += aShifthold == 1 ? 16 : 1; - break; - case 14: - paramH.value1D += aShifthold == 1 ? 16 : 1; - break; - case 15: - paramH.value0D *= aShifthold == 1 ? 16 : 2; - paramH.value1D *= aShifthold == 1 ? 16 : 2; - break; - default: - doStuff = false; - } - if (doStuff) { - IGregTechTileEntity base = paramH.getBaseMetaTileEntity(); - TecTech.proxy.playSound(base, "fx_click"); - if (paramH.param > 9) { - paramH.param = 9; - } else if (paramH.param < -1) { - paramH.param = -1; - } - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - param = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).param; - value0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; - value1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; - input0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; - input1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - TT_Utility.sendInteger(param, this, var1, 100); - TT_Utility.sendDouble(value0d, this, var1, 102); - TT_Utility.sendDouble(value1d, this, var1, 106); - TT_Utility.sendDouble(input0d, this, var1, 110); - TT_Utility.sendDouble(input1d, this, var1, 114); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - case 101: - param = TT_Utility.receiveInteger(param, 100, par1, par2); - return; - case 102: - case 103: - case 104: - case 105: - value0d = Double.longBitsToDouble(value0l = TT_Utility.receiveLong(value0l, 102, par1, par2)); - return; - case 106: - case 107: - case 108: - case 109: - value1d = Double.longBitsToDouble(value1l = TT_Utility.receiveLong(value1l, 106, par1, par2)); - return; - case 110: - case 111: - case 112: - case 113: - input0d = Double.longBitsToDouble(input0l = TT_Utility.receiveLong(input0l, 110, par1, par2)); - return; - case 114: - case 115: - case 116: - case 117: - input1d = Double.longBitsToDouble(input1l = TT_Utility.receiveLong(input1l, 114, par1, par2)); - return; - default: - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java deleted file mode 100644 index 26faae689f..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { - public int pointer = 0; - public int param = 0; - public double value1d = 0; - public double value0d = 0; - public double input0d = 0; - public double input1d = 0; - public long value0l = 0; - public long value1l = 0; - public long input0l = 0; - public long input1l = 0; - - public GT_Container_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - boolean doStuff = true; - GT_MetaTileEntity_Hatch_Param paramH = (GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity(); - int columnPointer = paramH.pointer & 0xff; - boolean secondRow = (paramH.pointer & 0x0100) != 0; - switch (aSlotIndex) { - case 0: - paramH.param -= aShifthold == 1 ? 16 : 4; - break; - case 1: - if (secondRow) { - secondRow = false; - } else { - columnPointer -= aShifthold == 1 ? 16 : 4; - } - break; - case 2: - if (secondRow) { - columnPointer -= aShifthold == 1 ? 16 : 4; - } else { - secondRow = true; - } - break; - case 3: - if (aShifthold == 1) { - if (secondRow) { - paramH.value1D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); - } else { - paramH.value0D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); - } - } else { - if (secondRow) { - long temp = Double.doubleToLongBits(paramH.value1D); - temp |= 1L << (long) columnPointer; - paramH.value1D = Double.longBitsToDouble(temp); - } else { - long temp = Double.doubleToLongBits(paramH.value0D); - temp |= 1L << (long) columnPointer; - paramH.value0D = Double.longBitsToDouble(temp); - } - } - break; - case 4: - paramH.param -= aShifthold == 1 ? 2 : 1; - break; - case 5: - if (secondRow) { - secondRow = false; - } else { - columnPointer -= aShifthold == 1 ? 2 : 1; - } - break; - case 6: - if (secondRow) { - columnPointer -= aShifthold == 1 ? 2 : 1; - } else { - secondRow = true; - } - break; - case 7: - if (aShifthold == 1) { - if (secondRow) { - paramH.value1D = Double.longBitsToDouble(0); - } else { - paramH.value0D = Double.longBitsToDouble(0); - } - } else { - if (secondRow) { - long temp = Double.doubleToLongBits(paramH.value1D); - temp &= ~(1L << (long) columnPointer); - paramH.value1D = Double.longBitsToDouble(temp); - } else { - long temp = Double.doubleToLongBits(paramH.value0D); - temp &= ~(1L << (long) columnPointer); - paramH.value0D = Double.longBitsToDouble(temp); - } - } - break; - case 8: - paramH.param += aShifthold == 1 ? 16 : 4; - break; - case 9: - if (secondRow) { - secondRow = false; - } else { - columnPointer += aShifthold == 1 ? 16 : 4; - } - break; - case 10: - if (secondRow) { - columnPointer += aShifthold == 1 ? 16 : 4; - } else { - secondRow = true; - } - break; - case 11: - paramH.value0D = paramH.input0D; - paramH.value1D = paramH.input1D; - break; - case 12: - paramH.param += aShifthold == 1 ? 2 : 1; - break; - case 13: - if (secondRow) { - secondRow = false; - } else { - columnPointer += aShifthold == 1 ? 2 : 1; - } - break; - case 14: - if (secondRow) { - columnPointer += aShifthold == 1 ? 2 : 1; - } else { - secondRow = true; - } - break; - case 15: - if (aShifthold == 1) { - if (secondRow) { - paramH.value1D = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1D)); - } else { - paramH.value0D = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1D)); - } - } else { - if (secondRow) { - long temp = Double.doubleToLongBits(paramH.value1D); - temp ^= 1L << (long) columnPointer; - paramH.value1D = Double.longBitsToDouble(temp); - } else { - long temp = Double.doubleToLongBits(paramH.value0D); - temp ^= 1L << (long) columnPointer; - paramH.value0D = Double.longBitsToDouble(temp); - } - } - break; - default: - doStuff = false; - } - if (doStuff) { - IGregTechTileEntity base = paramH.getBaseMetaTileEntity(); - TecTech.proxy.playSound(base, "fx_click"); - if (columnPointer >= 64) { - columnPointer = 63; - } else if (columnPointer < 0) { - columnPointer = 0; - } - paramH.pointer = secondRow ? columnPointer + 0x100 : columnPointer; - if (paramH.param > 9) { - paramH.param = 9; - } else if (paramH.param < -1) { - paramH.param = -1; - } - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - param = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).param; - value0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; - value1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; - input0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; - input1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; - pointer = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).pointer; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - TT_Utility.sendInteger(param, this, var1, 100); - TT_Utility.sendDouble(value0d, this, var1, 102); - TT_Utility.sendDouble(value1d, this, var1, 106); - TT_Utility.sendDouble(input0d, this, var1, 110); - TT_Utility.sendDouble(input1d, this, var1, 114); - TT_Utility.sendInteger(pointer, this, var1, 118); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - case 101: - param = TT_Utility.receiveInteger(param, 100, par1, par2); - return; - case 102: - case 103: - case 104: - case 105: - value0d = Double.longBitsToDouble(value0l = TT_Utility.receiveLong(value0l, 102, par1, par2)); - return; - case 106: - case 107: - case 108: - case 109: - value1d = Double.longBitsToDouble(value1l = TT_Utility.receiveLong(value1l, 106, par1, par2)); - return; - case 110: - case 111: - case 112: - case 113: - input0d = Double.longBitsToDouble(input0l = TT_Utility.receiveLong(input0l, 110, par1, par2)); - return; - case 114: - case 115: - case 116: - case 117: - input1d = Double.longBitsToDouble(input1l = TT_Utility.receiveLong(input1l, 114, par1, par2)); - return; - case 118: - case 119: - pointer = TT_Utility.receiveInteger(pointer, 118, par1, par2); - return; - default: - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java deleted file mode 100644 index f46e69184b..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.loader.NetworkDispatcher; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_ParamText; -import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import java.util.Objects; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_ParamText extends GT_ContainerMetaTile_Machine { - public int param = 0; - public double value0d = 0; - public double value1d = 0; - public double input0d = 0; - public double input1d = 0; - public long value0l = 0; - public long value1l = 0; - public long input0l = 0; - public long input1l = 0; - public String value0s = ""; - public String value1s = ""; - - public GT_Container_ParamText(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - boolean doStuff = true; - GT_MetaTileEntity_Hatch_ParamText paramH = - (GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity(); - switch (aSlotIndex) { - case 0: - paramH.param -= aShifthold == 1 ? 16 : 4; - break; - case 1: - paramH.param -= aShifthold == 1 ? 2 : 1; - break; - case 2: - paramH.param += aShifthold == 1 ? 16 : 4; - break; - case 3: - paramH.param += aShifthold == 1 ? 2 : 1; - break; - default: - doStuff = false; - } - if (doStuff) { - IGregTechTileEntity base = paramH.getBaseMetaTileEntity(); - TecTech.proxy.playSound(base, "fx_click"); - if (paramH.param > 9) { - paramH.param = 9; - } else if (paramH.param < -1) { - paramH.param = -1; - } - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - param = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).param; - value0d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0D; - value1d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value1D; - input0d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).input0D; - input1d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).input1D; - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - TT_Utility.sendInteger(param, this, var1, 100); - TT_Utility.sendDouble(value0d, this, var1, 102); - TT_Utility.sendDouble(value1d, this, var1, 106); - TT_Utility.sendDouble(input0d, this, var1, 110); - TT_Utility.sendDouble(input1d, this, var1, 114); - } - if (!Objects.equals(value0s, ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0s) - || !Objects.equals( - value0s, ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0s)) { - value0s = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0s; - value1s = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value1s; - for (Object object : crafters) { - if (object instanceof EntityPlayerMP) { - NetworkDispatcher.INSTANCE.sendTo( - new TextParametersMessage.ParametersTextData( - ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity())), - (EntityPlayerMP) object); - } - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - case 101: - param = TT_Utility.receiveInteger(param, 100, par1, par2); - return; - case 102: - case 103: - case 104: - case 105: - value0d = Double.longBitsToDouble(value0l = TT_Utility.receiveLong(value0l, 102, par1, par2)); - return; - case 106: - case 107: - case 108: - case 109: - value1d = Double.longBitsToDouble(value1l = TT_Utility.receiveLong(value1l, 106, par1, par2)); - return; - case 110: - case 111: - case 112: - case 113: - input0d = Double.longBitsToDouble(input0l = TT_Utility.receiveLong(input0l, 110, par1, par2)); - return; - case 114: - case 115: - case 116: - case 117: - input1d = Double.longBitsToDouble(input1l = TT_Utility.receiveLong(input1l, 114, par1, par2)); - return; - default: - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java deleted file mode 100644 index 16b38e254f..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -/** - * Created by Tec on 09.04.2017. - */ -public class GT_Container_Rack extends GT_ContainerMetaTile_Machine { - public boolean heat = false; - - public GT_Container_Rack(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(mTileEntity, 0, 69, 28)); - addSlotToContainer(new Slot(mTileEntity, 1, 91, 28)); - addSlotToContainer(new Slot(mTileEntity, 2, 69, 50)); - addSlotToContainer(new Slot(mTileEntity, 3, 91, 50)); - } - - @Override - public int getSlotCount() { - return 4; - } - - @Override - public int getShiftClickSlotCount() { - return 4; - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - heat = ((GT_MetaTileEntity_Hatch_Rack) mTileEntity.getMetaTileEntity()).heat > 0; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 100, heat ? 1 : 0); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - if (par1 == 100) { - heat = par2 != 0; - } - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (heat || mActive != 0) { - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { - if (heat || mActive != 0) { - return null; - } - return super.transferStackInSlot(aPlayer, aSlotIndex); - } - - @Override - public boolean canDragIntoSlot(Slot par1Slot) { - if (heat || mActive != 0) { - return false; - } - return super.canDragIntoSlot(par1Slot); - } - - @Override - public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { - if (heat || mActive != 0) { - return; - } - super.putStacksInSlots(par1ArrayOfItemStack); - } - - @Override - protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { - if (heat || mActive != 0) { - return false; - } - return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4); - } - - @Override - public void putStackInSlot(int par1, ItemStack par2ItemStack) { - if (heat || mActive != 0) { - return; - } - super.putStackInSlot(par1, par2ItemStack); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java deleted file mode 100644 index 88dab21c37..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Uncertainty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_Uncertainty extends GT_ContainerMetaTile_Machine { - public short[] matrix = - new short[] {500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}; - public byte selection = -1, mode = 0, status = -128; - - public GT_Container_Uncertainty(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_Hatch_Uncertainty catH = - (GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity(); - if (aSlotIndex < 16 && catH.matrix != null) { - IGregTechTileEntity base = catH.getBaseMetaTileEntity(); - TecTech.proxy.playSound(base, "fx_click"); - if (catH.selection == -1) { - catH.selection = (byte) aSlotIndex; - } else { - short temp = catH.matrix[catH.selection]; - catH.matrix[catH.selection] = catH.matrix[aSlotIndex]; - catH.matrix[aSlotIndex] = temp; - catH.selection = -1; - } - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - - ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).compute(); - - if (matrix != null) { - for (int i = 0; i < 16; i++) { - matrix[i] = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).matrix[i]; - } - } - - selection = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).selection; - mode = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).mode; - status = ((GT_MetaTileEntity_Hatch_Uncertainty) mTileEntity.getMetaTileEntity()).status; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 100, selection); - var1.sendProgressBarUpdate(this, 101, mode); - var1.sendProgressBarUpdate(this, 102, status); - - if (matrix != null) { - for (int i = 0; i < 16; i++) { - var1.sendProgressBarUpdate(this, 103 + i, matrix[i]); - } - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - selection = (byte) par2; - break; - case 101: - mode = (byte) par2; - break; - case 102: - status = (byte) par2; - break; - default: - if (matrix != null && par1 >= 103 && par1 < 119) { - matrix[par1 - 103] = (short) par2; - break; - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Capacitor.java deleted file mode 100644 index e97430d9bb..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Capacitor.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_Capacitor extends GT_GUIContainerMetaTile_Machine { - private final String mName; - - public GT_GUIContainer_Capacitor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_Capacitor(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/4by4.png"); - mName = aName; - } - - public GT_GUIContainer_Capacitor( - InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) { - super( - new GT_Container_Capacitor(aInventoryPlayer, aTileEntity), - "gregtech:textures/gui/" + aBackground + "4by4.png"); - this.mName = aName; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString(mName, 8, 4, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java deleted file mode 100644 index 7019a6128e..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -/** - * Created by Tec on 09.04.2017. - */ -public class GT_GUIContainer_Holder extends GT_GUIContainerMetaTile_Machine { - private final String mName; - - public GT_GUIContainer_Holder(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_Holder(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/holder.png"); - mName = aName; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString(mName, 8, 4, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null) { - if (((GT_Container_Holder) mContainer).mActive == 1) { - drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18); - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java deleted file mode 100644 index d5d3d64b37..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.font.TecTechFontRender; -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.opengl.GL11; - -public class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_Param(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Parametrizer.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (mContainer != null) { - TecTechFontRender.INSTANCE.drawSplitString( - "Parameters: " + ((GT_Container_Param) mContainer).param, 46, 7, 167, 0xffffff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b07" + TT_Utility.formatNumberExp(((GT_Container_Param) mContainer).input0d), - 46, - 16, - 167, - 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b07" + TT_Utility.formatNumberExp(((GT_Container_Param) mContainer).input1d), - 46, - 24, - 167, - 0x00ffff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b06" + TT_Utility.formatNumberExp(((GT_Container_Param) mContainer).value0d), - 46, - 33, - 167, - 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b06" + TT_Utility.formatNumberExp(((GT_Container_Param) mContainer).value1d), - 46, - 41, - 167, - 0x0077ff); - GL11.glPushMatrix(); - GL11.glScalef(.5f, .5f, .5f); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b06" - + TT_Utility.longBitsToShortString( - Double.doubleToLongBits(((GT_Container_Param) mContainer).value0d)), - 92, - 100, - 334, - 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b06" - + TT_Utility.longBitsToShortString( - Double.doubleToLongBits(((GT_Container_Param) mContainer).value1d)), - 92, - 116, - 334, - 0x0077ff); - GL11.glPopMatrix(); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Parameters", 46, 7, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java deleted file mode 100644 index 512a70d0a5..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.font.TecTechFontRender; -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.opengl.GL11; - -public class GT_GUIContainer_ParamAdv extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_ParamAdv(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerAdv.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (mContainer != null) { - TecTechFontRender.INSTANCE.drawSplitString( - "Parameters X: " + ((GT_Container_ParamAdv) mContainer).param, 46, 7, 167, 0xffffff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b07" + TT_Utility.formatNumberExp((((GT_Container_ParamAdv) mContainer).input0d)), - 46, - 16, - 167, - 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b07" + TT_Utility.formatNumberExp((((GT_Container_ParamAdv) mContainer).input1d)), - 46, - 24, - 167, - 0x00ffff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b06" + TT_Utility.formatNumberExp((((GT_Container_ParamAdv) mContainer).value0d)), - 46, - 33, - 167, - 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b06" + TT_Utility.formatNumberExp((((GT_Container_ParamAdv) mContainer).value1d)), - 46, - 41, - 167, - 0x0077ff); - GL11.glPushMatrix(); - GL11.glScalef(.5f, .5f, .5f); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b06" - + TT_Utility.longBitsToShortString( - Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value0d)), - 92, - 100, - 334, - 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b06" - + TT_Utility.longBitsToShortString( - Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value1d)), - 92, - 116, - 334, - 0x0077ff); - GL11.glPopMatrix(); - TecTechFontRender.INSTANCE.drawSplitString( - "Pointer " - + Integer.toHexString(((GT_Container_ParamAdv) mContainer).pointer | 0x10000) - .substring(1), - 46, - 66, - 167, - 0x0033ff); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Parameters X", 46, 7, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java deleted file mode 100644 index bff21e5f98..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.font.TecTechFontRender; -import com.github.technus.tectech.loader.NetworkDispatcher; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_ParamText; -import com.github.technus.tectech.thing.metaTileEntity.hatch.TextParametersMessage; -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import java.util.Objects; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { - private GuiTextField value0tb; - private GuiTextField value1tb; - - public GT_GUIContainer_ParamText(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_ParamText(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerText.png"); - } - - @Override - public void initGui() { - super.initGui(); - value0tb = new GuiTextField( - TecTechFontRender.INSTANCE, - (this.width - 176) / 2 + 12 + 14, - (this.height - 166) / 2 + 26, - 156 - 18, - 12); - value0tb.setMaxStringLength(80); - value1tb = new GuiTextField( - TecTechFontRender.INSTANCE, - (this.width - 176) / 2 + 12 + 14, - (this.height - 166) / 2 + 41, - 156 - 18, - 12); - value1tb.setMaxStringLength(80); - updateValues(); - } - - @Override - public void onGuiClosed() { - super.onGuiClosed(); - value0tb.setFocused(false); - value1tb.setFocused(false); - updateValues(); - } - - @Override - protected void keyTyped(char p_73869_1_, int p_73869_2_) { - value0tb.textboxKeyTyped(p_73869_1_, p_73869_2_); - value1tb.textboxKeyTyped(p_73869_1_, p_73869_2_); - if ((p_73869_2_ != 1 && p_73869_2_ != this.mc.gameSettings.keyBindInventory.getKeyCode()) - || (!value0tb.isFocused() && !value1tb.isFocused())) { - super.keyTyped(p_73869_1_, p_73869_2_); - } - updateValues(); - } - - @Override - public void updateScreen() { - super.updateScreen(); - value0tb.updateCursorCounter(); - value1tb.updateCursorCounter(); - } - - @Override - public void drawScreen(int par1, int par2, float par3) { - super.drawScreen(par1, par2, par3); - value0tb.drawTextBox(); - value1tb.drawTextBox(); - } - - @Override - protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) { - super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); - value0tb.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); - value1tb.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); - updateValues(); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (mContainer != null) { - TecTechFontRender.INSTANCE.drawSplitString( - "Parameters tXt: " + ((GT_Container_ParamText) mContainer).param, 46, 7, 167, 0xffffff); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06", 10, 29, 16, 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06", 10, 44, 16, 0x0077ff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u24EA\u2b07" + TT_Utility.formatNumberExp((((GT_Container_ParamText) mContainer).input0d)), - 10, - 56, - 167, - 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString( - "\u2460\u2b07" + TT_Utility.formatNumberExp((((GT_Container_ParamText) mContainer).input1d)), - 10, - 65, - 167, - 0x00ffff); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Parameters tXt", 46, 7, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } - - private void updateValues() { - updateIn0(); - updateIn1(); - } - - private void updateIn0() { - if (!value0tb.isFocused()) { - String str = value0tb.getText().toLowerCase(); - double val; - try { - if (str.contains("b")) { - String[] split = str.split("b"); - val = TT_Utility.bitStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); - } else if (str.contains("x")) { - String[] split = str.split("x"); - val = TT_Utility.hexStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); - } else { - val = TT_Utility.stringToDouble(str); - } - if (!Objects.equals( - ((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value0s, - value0tb.getText())) { - ((GT_Container_ParamText) mContainer).value0s = value0tb.getText(); - ((GT_Container_ParamText) mContainer).value0d = val; - ((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value0s = - value0tb.getText(); - - NetworkDispatcher.INSTANCE.sendToServer( - new TextParametersMessage.ParametersTextUpdate((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity())); - } - } catch (Exception e) { - value0tb.setText(((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value0s); - } - } - } - - private void updateIn1() { - if (!value1tb.isFocused()) { - String str = value1tb.getText().toLowerCase(); - double val; - try { - if (str.contains("b")) { - String[] split = str.split("b"); - val = TT_Utility.bitStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); - } else if (str.contains("x")) { - String[] split = str.split("x"); - val = TT_Utility.hexStringToInt(split[0].replaceAll("[^-]", "") + split[1].replaceAll("_", "")); - } else { - val = TT_Utility.stringToDouble(str); - } - if (!Objects.equals( - ((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value1s, - value1tb.getText())) { - ((GT_Container_ParamText) mContainer).value1s = value1tb.getText(); - ((GT_Container_ParamText) mContainer).value1d = val; - ((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value1s = - value1tb.getText(); - - NetworkDispatcher.INSTANCE.sendToServer( - new TextParametersMessage.ParametersTextUpdate((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity())); - } - } catch (Exception e) { - value1tb.setText(((GT_MetaTileEntity_Hatch_ParamText) - ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()) - .value1s); - } - } - } - - public void setTextIn0(String in0) { - ((GT_Container_ParamText) mContainer).value0s = in0; - this.value0tb.setText(in0); - } - - public void setTextIn1(String in1) { - ((GT_Container_ParamText) mContainer).value1s = in1; - this.value1tb.setText(in1); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java deleted file mode 100644 index 396a690a8f..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -/** - * Created by Tec on 09.04.2017. - */ -public class GT_GUIContainer_Rack extends GT_GUIContainerMetaTile_Machine { - private final String mName; - - public GT_GUIContainer_Rack(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_Rack(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/rack.png"); - mName = aName; - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString(mName, 8, 4, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null) { - if (((GT_Container_Rack) mContainer).mActive == 1) { - drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18); - } - if (((GT_Container_Rack) mContainer).heat) { - drawTexturedModalRect(x + 151, y + 41, 183, 41, 18, 18); - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java deleted file mode 100644 index 5ef1ac9bc5..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Uncertainty.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.font.TecTechFontRender; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import org.lwjgl.opengl.GL11; - -public class GT_GUIContainer_Uncertainty extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_Uncertainty(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_Uncertainty(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Uncertainty.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - TecTechFontRender.INSTANCE.drawSplitString("Schr\u00F6dinger", 46, 7, 167, 0xffffff); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).status == 0) { - TecTechFontRender.INSTANCE.drawSplitString("Status: OK", 46, 16, 167, 0xffffff); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Status: NG", 46, 16, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).matrix != null) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - short bU = 0, rU = 70, fU = 192, V = 210, Vs = 216; - x += 52; - y += 33; - int state = ((GT_Container_Uncertainty) mContainer).status; - switch (((GT_Container_Uncertainty) mContainer).mode) { - case 1: // ooo oxo ooo - drawTexturedModalRect(x + 12, y + 12, rU + (state == 0 ? 76 : 12), Vs + 12, 10, 10); - break; - case 2: // ooo xox ooo - drawTexturedModalRect(x, y + 12, rU + ((state & 1) == 0 ? 64 : 0), Vs + 12, 10, 10); - drawTexturedModalRect(x + 24, y + 12, rU + ((state & 2) == 0 ? 88 : 24), Vs + 12, 10, 10); - break; - case 3: // oxo xox oxo - drawTexturedModalRect(x + 12, y, rU + ((state & 1) == 0 ? 76 : 12), Vs, 10, 10); - drawTexturedModalRect(x, y + 12, rU + ((state & 2) == 0 ? 64 : 0), Vs + 12, 10, 10); - drawTexturedModalRect(x + 24, y + 12, rU + ((state & 4) == 0 ? 88 : 24), Vs + 12, 10, 10); - drawTexturedModalRect(x + 12, y + 24, rU + ((state & 8) == 0 ? 76 : 12), Vs + 24, 10, 10); - break; - case 4: // xox ooo xox - drawTexturedModalRect(x, y, rU + ((state & 1) == 0 ? 64 : 0), Vs, 10, 10); - drawTexturedModalRect(x + 24, y, rU + ((state & 2) == 0 ? 88 : 24), Vs, 10, 10); - drawTexturedModalRect(x, y + 24, rU + ((state & 4) == 0 ? 64 : 0), Vs + 24, 10, 10); - drawTexturedModalRect(x + 24, y + 24, rU + ((state & 8) == 0 ? 88 : 24), Vs + 24, 10, 10); - break; - case 5: // xox oxo xox - drawTexturedModalRect(x, y, rU + ((state & 1) == 0 ? 64 : 0), Vs, 10, 10); - drawTexturedModalRect(x + 24, y, rU + ((state & 2) == 0 ? 88 : 24), Vs, 10, 10); - drawTexturedModalRect(x + 12, y + 12, rU + ((state & 4) == 0 ? 76 : 12), Vs + 12, 10, 10); - drawTexturedModalRect(x, y + 24, rU + ((state & 8) == 0 ? 64 : 0), Vs + 24, 10, 10); - drawTexturedModalRect(x + 24, y + 24, rU + ((state & 16) == 0 ? 88 : 24), Vs + 24, 10, 10); - break; - } - x -= 6; - y -= 6; - for (int i = 0; i < 16; i++) { - if (TecTech.RANDOM.nextInt(1000) < ((GT_Container_Uncertainty) mContainer).matrix[i]) { - drawTexturedModalRect( - x + 12 * (i / 4), y + 12 * (i % 4), fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10); - } - } - if (((GT_Container_Uncertainty) mContainer).selection > -1) { - int sel = ((GT_Container_Uncertainty) mContainer).selection; - drawTexturedModalRect( - x + 12 * (sel / 4), y + 12 * (sel % 4), bU + 12 * (sel / 4), V + 12 * (sel % 4), 10, 10); - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java deleted file mode 100644 index 1e9bccfe88..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_UncertaintyAdv.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; -import static org.lwjgl.opengl.GL11.*; - -import com.github.technus.tectech.font.TecTechFontRender; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_UncertaintyAdv extends GT_GUIContainerMetaTile_Machine { - protected static final short sX = 52, sY = 33, bU = 0, rU = 70, fU = 192, V = 210, Vs = 216; - - public GT_GUIContainer_UncertaintyAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_Uncertainty(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Uncertainty.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - TecTechFontRender.INSTANCE.drawSplitString("Schr\u00F6dinger X", 46, 7, 167, 0xffffff); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).status == 0) { - TecTechFontRender.INSTANCE.drawSplitString("Status: OK", 46, 16, 167, 0xffffff); - } else { - TecTechFontRender.INSTANCE.drawSplitString("Status: NG", 46, 16, 167, 0xffffff); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null && ((GT_Container_Uncertainty) mContainer).matrix != null) { - glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - x += sX; - y += sY; - int state = ((GT_Container_Uncertainty) mContainer).status; - switch (((GT_Container_Uncertainty) mContainer).mode) { - case 1: // ooo oxo ooo - drawTexturedModalRect(x + 12, y + 12, rU + (state == 0 ? 76 : 12), Vs + 12, 10, 10); - break; - case 2: // ooo xox ooo - drawTexturedModalRect(x, y + 12, rU + ((state & 1) == 0 ? 64 : 0), Vs + 12, 10, 10); - drawTexturedModalRect(x + 24, y + 12, rU + ((state & 2) == 0 ? 88 : 24), Vs + 12, 10, 10); - break; - case 3: // oxo xox oxo - drawTexturedModalRect(x + 12, y, rU + ((state & 1) == 0 ? 76 : 12), Vs, 10, 10); - drawTexturedModalRect(x, y + 12, rU + ((state & 2) == 0 ? 64 : 0), Vs + 12, 10, 10); - drawTexturedModalRect(x + 24, y + 12, rU + ((state & 4) == 0 ? 88 : 24), Vs + 12, 10, 10); - drawTexturedModalRect(x + 12, y + 24, rU + ((state & 8) == 0 ? 76 : 12), Vs + 24, 10, 10); - break; - case 4: // xox ooo xox - drawTexturedModalRect(x, y, rU + ((state & 1) == 0 ? 64 : 0), Vs, 10, 10); - drawTexturedModalRect(x + 24, y, rU + ((state & 2) == 0 ? 88 : 24), Vs, 10, 10); - drawTexturedModalRect(x, y + 24, rU + ((state & 4) == 0 ? 64 : 0), Vs + 24, 10, 10); - drawTexturedModalRect(x + 24, y + 24, rU + ((state & 8) == 0 ? 88 : 24), Vs + 24, 10, 10); - break; - case 5: // xox ooo xox - drawTexturedModalRect(x, y, rU + ((state & 1) == 0 ? 64 : 0), Vs, 10, 10); - drawTexturedModalRect(x + 24, y, rU + ((state & 2) == 0 ? 88 : 24), Vs, 10, 10); - drawTexturedModalRect(x + 12, y + 12, rU + ((state & 4) == 0 ? 76 : 12), Vs + 12, 10, 10); - drawTexturedModalRect(x, y + 24, rU + ((state & 8) == 0 ? 64 : 0), Vs + 24, 10, 10); - drawTexturedModalRect(x + 24, y + 24, rU + ((state & 16) == 0 ? 88 : 24), Vs + 24, 10, 10); - break; - } - x -= 6; - y -= 6; - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - for (int i = 0; i < 16; i++) { - glColor4f(1f, 1f, 1f, (float) ((GT_Container_Uncertainty) mContainer).matrix[i] / 1000f); - drawTexturedModalRect(x + 12 * (i / 4), y + 12 * (i % 4), fU + 12 * (i / 4), V + 12 * (i % 4), 10, 10); - } - glDisable(GL_BLEND); - - glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (((GT_Container_Uncertainty) mContainer).selection > -1) { - int sel = ((GT_Container_Uncertainty) mContainer).selection; - drawTexturedModalRect( - x + 12 * (sel / 4), y + 12 * (sel % 4), bU + 12 * (sel / 4), V + 12 * (sel % 4), 10, 10); - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 01eab07bd5..c663fea79b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -14,8 +14,6 @@ import com.github.technus.tectech.Reference; import com.github.technus.tectech.mechanics.dataTransport.InventoryDataPacket; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputDataItems; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputDataItems; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.github.technus.tectech.util.CommonValues; @@ -38,7 +36,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -176,23 +173,6 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, - aBaseMetaTileEntity, - getLocalName(), - "EMDisplay.png", - true, - false, - true); // todo texture - } - - @Override public ITexture[] getTexture( IGregTechTileEntity aBaseMetaTileEntity, byte aSide, @@ -301,4 +281,19 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB return GT_MetaTileEntity_EM_dataBank::addDataBankHatchToMachineList; } } + + @Override + public boolean isPowerPassButtonEnabled() { + return true; + } + + @Override + public boolean isSafeVoidButtonEnabled() { + return false; + } + + @Override + public boolean isAllowedToWorkButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index d7159ab682..de338c53e8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -12,8 +12,6 @@ import static net.minecraft.util.StatCollector.translateToLocal; import cofh.api.energy.IEnergyContainerItem; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.util.CommonValues; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; @@ -27,7 +25,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -277,17 +274,6 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa return tt; } - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, true); - } - public static final ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_whooum"); @Override @@ -310,4 +296,19 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa public String[] getStructureDescription(ItemStack stackSize) { return description; } + + @Override + public boolean isPowerPassButtonEnabled() { + return true; + } + + @Override + public boolean isSafeVoidButtonEnabled() { + return false; + } + + @Override + public boolean isAllowedToWorkButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index 613dbe0e21..faf94436ce 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -13,8 +13,6 @@ import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static net.minecraft.util.StatCollector.translateToLocal; import com.github.technus.tectech.Reference; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.github.technus.tectech.util.CommonValues; @@ -29,7 +27,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; @@ -154,17 +151,6 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, false); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, false); - } - - @Override public ITexture[] getTexture( IGregTechTileEntity aBaseMetaTileEntity, byte aSide, @@ -224,4 +210,19 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo public String[] getStructureDescription(ItemStack stackSize) { return description; } + + @Override + public boolean isPowerPassButtonEnabled() { + return true; + } + + @Override + public boolean isSafeVoidButtonEnabled() { + return false; + } + + @Override + public boolean isAllowedToWorkButtonEnabled() { + return false; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 4406977759..112405ff05 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -29,7 +29,6 @@ import java.util.HashSet; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; @@ -240,23 +239,6 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, - aBaseMetaTileEntity, - getLocalName(), - "EMDisplay.png", - true, - false, - true); // todo texture - } - - @Override public ITexture[] getTexture( IGregTechTileEntity aBaseMetaTileEntity, byte aSide, @@ -326,4 +308,19 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock public String[] getStructureDescription(ItemStack stackSize) { return description; } + + @Override + public boolean isPowerPassButtonEnabled() { + return true; + } + + @Override + public boolean isSafeVoidButtonEnabled() { + return false; + } + + @Override + public boolean isAllowedToWorkButtonEnabled() { + return true; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java index d38e41a695..fcbb23a1cd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_proccessingStack.java @@ -108,16 +108,6 @@ public class GT_MetaTileEntity_TM_proccessingStack extends GT_MetaTileEntity_Mul } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity,true, false, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",true, false, true); - } - - @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return new ITexture[]{Textures.BlockIcons.casingTexturePages[0][49], new TT_RenderedExtendedFacingTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java index a26003dd74..66d7acf2c2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java @@ -11,6 +11,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +@Deprecated public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { public LedStatus[] eParamsInStatus = LedStatus.makeArray(20, LedStatus.STATUS_UNDEFINED); public LedStatus[] eParamsOutStatus = LedStatus.makeArray(20, LedStatus.STATUS_UNDEFINED); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java index 0c20d76dae..cca5eee361 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java @@ -15,6 +15,7 @@ import org.lwjgl.opengl.GL12; /** * Created by Tec on 21.02.2017. */ +@Deprecated public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Machine { protected final String mName; protected static byte counter = 0; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index bc5cece66c..69f1515d4a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -7,6 +7,7 @@ import static com.github.technus.tectech.util.CommonValues.*; import static com.github.technus.tectech.util.DoubleCount.div; import static com.github.technus.tectech.util.TT_Utility.getTier; import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static java.lang.Math.min; import com.github.technus.tectech.Reference; @@ -15,6 +16,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.EMException; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefinitionStack; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMInstanceStack; +import com.github.technus.tectech.thing.gui.TecTechUITextures; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; import com.github.technus.tectech.util.TT_Utility; @@ -29,6 +31,17 @@ import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.util.Vec3Impl; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Pos2d; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.api.widget.Widget; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.SlotWidget; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -36,6 +49,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IBindPlayerInventoryUI; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -51,19 +65,19 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.lwjgl.opengl.GL11; /** * Created by danie_000 on 27.10.2016. */ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEntity_TooltipMultiBlockBase - implements IAlignment { + implements IAlignment, IBindPlayerInventoryUI { // region Client side variables (static - one per class) // Front icon holders - static so it is default one for my blocks @@ -517,33 +531,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt // region GUI/SOUND/RENDER /** - * Server side container - * - * @param aID - * @param aPlayerInventory - * @param aBaseMetaTileEntity - * @return - */ - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity); - } - - /** - * Client side gui - * - * @param aID - * @param aPlayerInventory - * @param aBaseMetaTileEntity - * @return - */ - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM( - aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png"); - } - - /** * add more textures * * @param aBlockIconRegister @@ -2904,4 +2891,357 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } return false; } + + // region ModularUI + + @Override + public int getGUIWidth() { + return 198; + } + + @Override + public int getGUIHeight() { + return 192; + } + + @Override + public void bindPlayerInventoryUI(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.bindPlayerInventory( + buildContext.getPlayer(), new Pos2d(7, 109), getGUITextureSet().getItemSlot()); + } + + public boolean isPowerPassButtonEnabled() { + return true; + } + + public boolean isSafeVoidButtonEnabled() { + return true; + } + + public boolean isAllowedToWorkButtonEnabled() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO_DARK) + .setSize(18, 18) + .setPos(173, 74)); + } + + private static byte LEDCounter = 0; + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(4, 4) + .setSize(190, 91)); + final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1); + builder.widget(inventorySlot + .setBackground(getGUITextureSet().getItemSlot(), TecTechUITextures.OVERLAY_SLOT_MESH) + .setPos(173, 167)) + .widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_HEAT_SINK_SMALL) + .setPos(173, 185) + .setSize(18, 6)); + + final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); + drawTexts(screenElements, inventorySlot); + builder.widget(screenElements.setPos(7, 8)); + + Widget powerPassButton = new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (isPowerPassButtonEnabled() || ePowerPassCover) { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + ePowerPass = !ePowerPass; + if (!isAllowedToWorkButtonEnabled()) { // TRANSFORMER HACK + if (ePowerPass) { + getBaseMetaTileEntity().enableWorking(); + } else { + getBaseMetaTileEntity().disableWorking(); + } + } + } + }) + .setPlayClickSound(false) + .setBackground(() -> { + List<UITexture> ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); + if (!isPowerPassButtonEnabled() && !ePowerPassCover) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_PASS_DISABLED); + } else { + if (ePowerPass) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_PASS_ON); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_PASS_OFF); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, 116) + .setSize(16, 16); + if (isPowerPassButtonEnabled()) { + powerPassButton.addTooltip("Power Pass").setTooltipShowUpDelay(TOOLTIP_DELAY); + } + builder.widget(powerPassButton) + .widget(new FakeSyncWidget.BooleanSyncer(() -> ePowerPass, val -> ePowerPass = val)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> ePowerPassCover, val -> ePowerPassCover = val)); + Widget safeVoidButton = new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (isSafeVoidButtonEnabled()) { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + eSafeVoid = !eSafeVoid; + } + }) + .setPlayClickSound(false) + .setBackground(() -> { + List<UITexture> ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); + if (!isSafeVoidButtonEnabled()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_DISABLED); + } else { + if (eSafeVoid) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_ON); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_SAFE_VOID_OFF); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, 132) + .setSize(16, 16); + if (isSafeVoidButtonEnabled()) { + safeVoidButton.addTooltip("Safe Void").setTooltipShowUpDelay(TOOLTIP_DELAY); + } + builder.widget(safeVoidButton) + .widget(new FakeSyncWidget.BooleanSyncer(() -> eSafeVoid, val -> eSafeVoid = val)); + Widget powerSwitchButton = new ButtonWidget() + .setOnClick((clickData, widget) -> { + if (isAllowedToWorkButtonEnabled()) { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + if (getBaseMetaTileEntity().isAllowedToWork()) { + getBaseMetaTileEntity().disableWorking(); + } else { + getBaseMetaTileEntity().enableWorking(); + } + } + }) + .setPlayClickSound(false) + .setBackground(() -> { + List<UITexture> ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_STANDARD_16x16); + if (!isAllowedToWorkButtonEnabled()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_DISABLED); + } else { + if (getBaseMetaTileEntity().isAllowedToWork()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF); + } + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, 148) + .setSize(16, 16); + if (isAllowedToWorkButtonEnabled()) { + powerSwitchButton.addTooltip("Power Switch").setTooltipShowUpDelay(TOOLTIP_DELAY); + } + builder.widget(powerSwitchButton) + .widget(new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isAllowedToWork(), val -> { + if (val) getBaseMetaTileEntity().enableWorking(); + else getBaseMetaTileEntity().disableWorking(); + })); + + builder.widget( + new DrawableWidget() { + @Override + public void draw(float partialTicks) { + super.draw(partialTicks); + LEDCounter = (byte) ((1 + LEDCounter) % 6); + } + }.setDrawable(TecTechUITextures.PICTURE_PARAMETER_BLANK) + .setPos(5, 96) + .setSize(166, 12)); + for (int hatch = 0; hatch < 10; hatch++) { + for (int param = 0; param < 2; param++) { + addParameterLED(builder, hatch, param, true); + addParameterLED(builder, hatch, param, false); + } + } + + builder.widget(new DrawableWidget() + .setDrawable(TecTechUITextures.PICTURE_UNCERTAINTY_MONITOR_MULTIMACHINE) + .setPos(173, 96) + .setSize(18, 18)); + for (int i = 0; i < 9; i++) { + final int index = i; + builder.widget(new DrawableWidget() + .setDrawable(() -> { + UITexture valid = TecTechUITextures.PICTURE_UNCERTAINTY_VALID[index]; + UITexture invalid = TecTechUITextures.PICTURE_UNCERTAINTY_INVALID[index]; + switch (eCertainMode) { + case 1: // ooo oxo ooo + if (index == 4) return eCertainStatus == 0 ? valid : invalid; + break; + case 2: // ooo xox ooo + if (index == 3) return (eCertainStatus & 1) == 0 ? valid : invalid; + if (index == 5) return (eCertainStatus & 2) == 0 ? valid : invalid; + break; + case 3: // oxo xox oxo + if (index == 1) return (eCertainStatus & 1) == 0 ? valid : invalid; + if (index == 3) return (eCertainStatus & 2) == 0 ? valid : invalid; + if (index == 5) return (eCertainStatus & 4) == 0 ? valid : invalid; + if (index == 7) return (eCertainStatus & 8) == 0 ? valid : invalid; + break; + case 4: // xox ooo xox + if (index == 0) return (eCertainStatus & 1) == 0 ? valid : invalid; + if (index == 2) return (eCertainStatus & 2) == 0 ? valid : invalid; + if (index == 6) return (eCertainStatus & 4) == 0 ? valid : invalid; + if (index == 8) return (eCertainStatus & 8) == 0 ? valid : invalid; + break; + case 5: // xox oxo xox + if (index == 0) return (eCertainStatus & 1) == 0 ? valid : invalid; + if (index == 2) return (eCertainStatus & 2) == 0 ? valid : invalid; + if (index == 4) return (eCertainStatus & 4) == 0 ? valid : invalid; + if (index == 6) return (eCertainStatus & 8) == 0 ? valid : invalid; + if (index == 8) return (eCertainStatus & 16) == 0 ? valid : invalid; + break; + } + return null; + }) + .setPos(174 + (index % 3) * 6, 97 + (index / 3) * 6) + .setSize(4, 4)); + } + builder.widget(new FakeSyncWidget.ByteSyncer(() -> eCertainMode, val -> eCertainMode = val)) + .widget(new FakeSyncWidget.ByteSyncer(() -> eCertainStatus, val -> eCertainStatus = val)); + } + + private void addParameterLED(ModularWindow.Builder builder, int hatch, int param, boolean input) { + final int parameterIndex = hatch + param * 10; + final int posIndex = hatch * 2 + param; + builder.widget( + new DrawableWidget() { + @Override + public void draw(float partialTicks) { + IDrawable texture = null; + final LedStatus status = input + ? parametrization.eParamsInStatus[parameterIndex] + : parametrization.eParamsOutStatus[parameterIndex]; + switch (status) { + case STATUS_WTF: { + int c = LEDCounter; + if (c > 4) { + c = TecTech.RANDOM.nextInt(5); + } + switch (c) { + case 0: + texture = TecTechUITextures.PICTURE_PARAMETER_BLUE[posIndex]; + break; + case 1: + texture = TecTechUITextures.PICTURE_PARAMETER_CYAN[posIndex]; + break; + case 2: + texture = TecTechUITextures.PICTURE_PARAMETER_GREEN[posIndex]; + break; + case 3: + texture = TecTechUITextures.PICTURE_PARAMETER_ORANGE[posIndex]; + break; + case 4: + texture = TecTechUITextures.PICTURE_PARAMETER_RED[posIndex]; + break; + } + break; + } + case STATUS_WRONG: // fallthrough + if (LEDCounter < 2) { + texture = TecTechUITextures.PICTURE_PARAMETER_BLUE[posIndex]; + break; + } else if (LEDCounter < 4) { + texture = TecTechUITextures.PICTURE_PARAMETER_RED[posIndex]; + break; + } + case STATUS_OK: // ok + texture = TecTechUITextures.PICTURE_PARAMETER_GREEN[posIndex]; + break; + case STATUS_TOO_LOW: // too low blink + if (LEDCounter < 3) { + texture = TecTechUITextures.PICTURE_PARAMETER_BLUE[posIndex]; + break; + } + case STATUS_LOW: // too low + texture = TecTechUITextures.PICTURE_PARAMETER_CYAN[posIndex]; + break; + case STATUS_TOO_HIGH: // too high blink + if (LEDCounter < 3) { + texture = TecTechUITextures.PICTURE_PARAMETER_RED[posIndex]; + break; + } + case STATUS_HIGH: // too high + texture = TecTechUITextures.PICTURE_PARAMETER_ORANGE[posIndex]; + break; + case STATUS_NEUTRAL: + if (LEDCounter < 3) { + GL11.glColor4f(.85f, .9f, .95f, .5F); + } else { + GL11.glColor4f(.8f, .9f, 1f, .5F); + } + texture = TecTechUITextures.PICTURE_PARAMETER_GRAY; + break; + case STATUS_UNDEFINED: + if (LEDCounter < 3) { + GL11.glColor4f(.5f, .1f, .15f, .5F); + } else { + GL11.glColor4f(0f, .1f, .2f, .5F); + } + texture = TecTechUITextures.PICTURE_PARAMETER_GRAY; + break; + case STATUS_UNUSED: + default: + // if (GregTech_API.sColoredGUI && this.mContainer.mTileEntity != null) { + // int tColor = this.mContainer.mTileEntity.getColorization() & 15; + // if (tColor < ItemDye.field_150922_c.length) { + // tColor = ItemDye.field_150922_c[tColor]; + // GL11.glColor4f((float)(tColor >> 16 & 255) / 255.0F, (float)(tColor >> 8 & + // 255) / 255.0F, + // (float)(tColor & 255) / 255.0F, 1F); + // } + // } + // drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); + // GL11.glColor4f(1f, 1f, 1f, 1f); + // break; + } + setDrawable(texture); + super.draw(partialTicks); + GL11.glColor4f(1f, 1f, 1f, 1f); + } + }.dynamicTooltip(() -> { + if (input) { + return getFullLedDescriptionIn(hatch, param); + } else { + return getFullLedDescriptionOut(hatch, param); + } + }) + .setPos(12 + posIndex * 8, 97 + (input ? 0 : 1) * 6) + .setSize(6, 4)); + if (input) { + builder.widget(new FakeSyncWidget.ByteSyncer( + () -> parametrization.eParamsInStatus[parameterIndex].getOrdinalByte(), + val -> parametrization.eParamsInStatus[parameterIndex] = LedStatus.getStatus(val))) + .widget(new FakeSyncWidget.DoubleSyncer( + () -> parametrization.iParamsIn[parameterIndex], + val -> parametrization.iParamsIn[parameterIndex] = val)); + } else { + builder.widget(new FakeSyncWidget.ByteSyncer( + () -> parametrization.eParamsOutStatus[parameterIndex].getOrdinalByte(), + val -> parametrization.eParamsOutStatus[parameterIndex] = LedStatus.getStatus(val))) + .widget(new FakeSyncWidget.DoubleSyncer( + () -> parametrization.iParamsOut[parameterIndex], + val -> parametrization.iParamsOut[parameterIndex] = val)); + } + } + + // endregion } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java index b3be875b85..63c5e142e0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java @@ -1,29 +1,39 @@ package com.github.technus.tectech.thing.metaTileEntity.single; import static com.github.technus.tectech.thing.metaTileEntity.Textures.*; +import static com.github.technus.tectech.util.CommonValues.VN; import static net.minecraft.util.StatCollector.translateToLocal; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_BuckConverter; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_BuckConverter; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import java.util.function.Consumer; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMachineBlock { +public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMachineBlock + implements IAddUIWidgets, IAddGregtechLogo { private static GT_RenderedTexture BUCK, BUCK_ACTIVE; public int EUT = 0, AMP = 0; @@ -74,16 +84,6 @@ public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMac } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_BuckConverter(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BuckConverter(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { return false; } @@ -113,10 +113,7 @@ public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMac @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -208,4 +205,75 @@ public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMac public int maxProgresstime() { return (int) getBaseMetaTileEntity().getUniversalEnergyCapacity(); } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) + .setSize(17, 17) + .setPos(113, 56)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setSize(90, 72) + .setPos(43, 4)) + .widget(TextWidget.dynamicString(() -> "EUT: " + EUT) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 8)) + .widget(TextWidget.dynamicString(() -> "TIER: " + VN[TT_Utility.getTier(Math.abs(EUT))]) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 16)) + .widget(TextWidget.dynamicString(() -> "AMP: " + AMP) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 24)) + .widget(TextWidget.dynamicString(() -> "SUM: " + (long) AMP * EUT) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 32)); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> EUT -= val, 512, 64, 7, 4); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> EUT /= val, 512, 64, 7, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> AMP -= val, 512, 64, 7, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> AMP /= val, 512, 64, 7, 58); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> EUT -= val, 16, 1, 25, 4); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> EUT /= val, 16, 2, 25, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> AMP -= val, 16, 1, 25, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> AMP /= val, 16, 2, 25, 58); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> EUT += val, 16, 1, 133, 4); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> EUT *= val, 16, 2, 133, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> AMP += val, 16, 1, 133, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> AMP *= val, 16, 2, 133, 58); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> EUT += val, 512, 64, 151, 4); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> EUT *= val, 512, 64, 151, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> AMP += val, 512, 64, 151, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> AMP *= val, 512, 64, 151, 58); + } + + private void addChangeNumberButton( + ModularWindow.Builder builder, + IDrawable overlay, + Consumer<Integer> setter, + int changeNumberShift, + int changeNumber, + int xPos, + int yPos) { + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + setter.accept(clickData.shift ? changeNumberShift : changeNumber); + getBaseMetaTileEntity().setActive((long) AMP * EUT >= 0); + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) + .setSize(18, 18) + .setPos(xPos, yPos)); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java index 90f1d17dec..03a98d53bf 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java @@ -1,43 +1,26 @@ package com.github.technus.tectech.thing.metaTileEntity.single; -import static com.github.technus.tectech.Reference.MODID; -import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_CASINGS_TT; import static com.github.technus.tectech.util.CommonValues.V; -import static net.minecraft.util.StatCollector.translateToLocal; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DataReader; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DataReader; -import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; import java.util.*; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; /** * Created by Tec on 23.03.2017. */ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine { - private static final HashMap<TT_Utility.ItemStack_NoNBT, ArrayList<IDataRender>> RENDER_REGISTRY = new HashMap<>(); public static GT_RenderedTexture READER_ONLINE, READER_OFFLINE; public GT_MetaTileEntity_DataReader(int aID, String aName, String aNameRegional, int aTier) { @@ -96,21 +79,12 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine } @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + return false; + } + + @Override public int checkRecipe() { - if (getOutputAt(0) != null) { - return DID_NOT_FIND_RECIPE; - } - ItemStack input = getInputAt(0); - for (IDataRender render : getRenders(new TT_Utility.ItemStack_NoNBT(input))) { - if (render.canRender(input, mTier)) { - mOutputItems[0] = input.copy(); - input.stackSize -= 1; - calculateOverclockedNess(render.getReadingEUt(), render.getReadingTime()); - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - return FOUND_AND_SUCCESSFULLY_USED_RECIPE; - } - } return DID_NOT_FIND_RECIPE; } @@ -121,23 +95,6 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_DataReader(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_DataReader( - aPlayerInventory, - aBaseMetaTileEntity, - getLocalName(), - mGUIName, - GT_Utility.isStringValid(mNEIName) - ? mNEIName - : getRecipeList() != null ? getRecipeList().mUnlocalizedName : ""); - } - - @Override public boolean isSimpleMachine() { return false; } @@ -149,14 +106,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine @Override public String[] getDescription() { - return new String[] { - CommonValues.TEC_MARK_GENERAL, - translateToLocal("gt.blockmachines.machine.tt.datareader.desc.0"), // Reads Data Sticks and Orbs - EnumChatFormatting.BLUE - + translateToLocal("gt.blockmachines.machine.tt.datareader.desc.1"), // Power it up and - EnumChatFormatting.BLUE - + translateToLocal("gt.blockmachines.machine.tt.datareader.desc.2") // Put the data storage in - }; + return new String[] {EnumChatFormatting.DARK_RED + "Deprecated"}; } @Override @@ -193,175 +143,4 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine public long getMinimumStoredEU() { return maxEUInput() * 4L; } - - public static void addDataRender(TT_Utility.ItemStack_NoNBT stack, IDataRender render) { - ArrayList<IDataRender> renders = RENDER_REGISTRY.computeIfAbsent(stack, k -> new ArrayList<>()); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { - render.loadResources(); - } - renders.add(render); - } - - public static List<IDataRender> getRenders(TT_Utility.ItemStack_NoNBT stack) { - ArrayList<IDataRender> iDataRenders = RENDER_REGISTRY.get(stack); - return iDataRenders == null ? Collections.emptyList() : iDataRenders; - } - - public interface IDataRender { - @SideOnly(Side.CLIENT) - void loadResources(); - - @SideOnly(Side.CLIENT) - void initRender(ItemStack itemStack); - - @SideOnly(Side.CLIENT) - void renderTooltips(ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui); - - @SideOnly(Side.CLIENT) - void renderForeground( - ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui, FontRenderer font); - - @SideOnly(Side.CLIENT) - void renderBackgroundOverlay( - ItemStack itemStack, int mouseX, int mouseY, int X, int Y, GT_GUIContainer_DataReader gui); - - boolean canRender(ItemStack itemStack, byte tier); - - int getReadingEUt(); - - int getReadingTime(); - } - - public static void run() { - addDataRender(new TT_Utility.ItemStack_NoNBT(ItemList.Tool_DataStick.get(1)), new IDataRender() { - @SideOnly(Side.CLIENT) - private ResourceLocation bg; - - @SideOnly(Side.CLIENT) - private HashMap<GT_Slot_Holo, ItemStack> slots; - - private HashMap<GT_Slot_Holo, ItemStack[]> slots2; - - @Override - @SideOnly(Side.CLIENT) - public void loadResources() { - bg = new ResourceLocation(MODID + ":textures/gui/assLineRender.png"); - } - - @Override - public void initRender(ItemStack itemStack) { - slots = new HashMap<>(); - slots2 = new HashMap<>(); - - slots.put( - new GT_Slot_Holo(null, 0, 143, 55, false, false, 1), - ItemList.Tool_DataStick.getWithName(1, "Research data")); - ItemStack output = ItemStack.loadItemStackFromNBT(itemStack.stackTagCompound.getCompoundTag("output")); - if (output != null) { - slots.put(new GT_Slot_Holo(null, 0, 143, 19, false, false, 64), output); - } - - for (int i = 0; i < 16; i++) { - ArrayList<ItemStack> array = new ArrayList<>(); - ItemStack input = ItemStack.loadItemStackFromNBT( - itemStack.stackTagCompound.getCompoundTag(Integer.toString(i))); - if (input != null) { - array.add(input); - } - for (int k = 0; k < itemStack.stackTagCompound.getInteger("a" + i); k++) { - input = ItemStack.loadItemStackFromNBT( - itemStack.stackTagCompound.getCompoundTag("a" + i + ":" + k)); - if (input != null) { - array.add(input); - } - } - if (array.size() > 0) { - slots2.put( - new GT_Slot_Holo(null, 0, 17 + (i & 0x3) * 18, 19 + (i >> 2) * 18, false, false, 64), - array.toArray(nullItem)); - } - } - for (int i = 0; i < 4; i++) { - FluidStack fs = - FluidStack.loadFluidStackFromNBT(itemStack.stackTagCompound.getCompoundTag("f" + i)); - if (fs != null) { - slots.put( - new GT_Slot_Holo(null, 0, 107, 19 + i * 18, false, false, 1), - GT_Utility.getFluidDisplayStack(fs, true)); - } - } - } - - @Override - public void renderTooltips(ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui) { - for (Map.Entry<GT_Slot_Holo, ItemStack> entry : slots.entrySet()) { - gui.renderTooltipSimple(mouseX, mouseY, entry.getKey(), entry.getValue()); - } - int time = (int) (System.currentTimeMillis() / 2000); - for (Map.Entry<GT_Slot_Holo, ItemStack[]> entry : slots2.entrySet()) { - gui.renderTooltipSimple( - mouseX, mouseY, entry.getKey(), entry.getValue()[time % entry.getValue().length]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void renderForeground( - ItemStack itemStack, int mouseX, int mouseY, GT_GUIContainer_DataReader gui, FontRenderer font) { - int time = itemStack.stackTagCompound.getInteger("time"); - int EUt = itemStack.stackTagCompound.getInteger("eu"); - font.drawString(translateToLocal("tt.keyphrase.Ass_line_recipe"), 7, 8, 0x80a0ff); - font.drawString( - GT_Utility.trans("152", "Total: ") + GT_Utility.formatNumbers((long) time * EUt) + " EU", - 7, - 93, - 0x80a0ff); - font.drawString( - GT_Utility.trans("153", "Usage: ") + GT_Utility.formatNumbers(EUt) + " EU/t", 7, 103, 0x80a0ff); - font.drawString( - GT_Utility.trans("154", "Voltage: ") + GT_Utility.formatNumbers(EUt) + " EU", 7, 113, 0x80a0ff); - font.drawString(GT_Utility.trans("155", "Amperage: ") + 1, 7, 123, 0x80a0ff); - font.drawString( - GT_Utility.trans("158", "Time: ") - + GT_Utility.formatNumbers(0.05d * time) - + GT_Utility.trans("161", " secs"), - 7, - 133, - 0x80a0ff); - - for (Map.Entry<GT_Slot_Holo, ItemStack> entry : slots.entrySet()) { - gui.renderItemSimple(entry.getKey(), entry.getValue()); - } - time = (int) (System.currentTimeMillis() / 2000); - for (Map.Entry<GT_Slot_Holo, ItemStack[]> entry : slots2.entrySet()) { - gui.renderItemSimple(entry.getKey(), entry.getValue()[time % entry.getValue().length]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void renderBackgroundOverlay( - ItemStack itemStack, int mouseX, int mouseY, int X, int Y, GT_GUIContainer_DataReader gui) { - // 176/83 - gui.mc.getTextureManager().bindTexture(bg); - gui.drawTexturedModalRect(X, Y, 0, 0, 176, 151); - } - - @Override - public boolean canRender(ItemStack itemStack, byte tier) { - NBTTagCompound nbtTagCompound = itemStack.stackTagCompound; - return nbtTagCompound != null && nbtTagCompound.hasKey("output"); - } - - @Override - public int getReadingEUt() { - return (int) V[4]; - } - - @Override - public int getReadingTime() { - return 128; - } - }); - } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java index d1990fc316..6a48095d55 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java @@ -5,22 +5,30 @@ import static net.minecraft.util.StatCollector.translateToLocal; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OverflowElemental; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugPollutor; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugPollutor; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; import gregtech.common.GT_Pollution; +import java.util.function.Consumer; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -28,7 +36,8 @@ import net.minecraft.util.EnumChatFormatting; /** * Created by Tec on 23.03.2017. */ -public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMachineBlock { +public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMachineBlock + implements IAddUIWidgets, IAddGregtechLogo { private static GT_RenderedTexture POLLUTOR; public int pollution = 0; public float anomaly = 0; @@ -79,16 +88,6 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_DebugPollutor(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_DebugPollutor(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { return false; } @@ -138,10 +137,7 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -171,4 +167,81 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac public boolean isElectric() { return false; } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) + .setSize(17, 17) + .setPos(113, 56)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setSize(90, 72) + .setPos(43, 4)) + .widget(TextWidget.dynamicString(() -> "Pollution: " + pollution) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 8)) + .widget(TextWidget.dynamicString(() -> "Anomaly: " + anomaly) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 16)); + + addChangeNumberButton( + builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> pollution -= val, 512, 64, 7, 4); + addChangeNumberButton( + builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> pollution /= val, 512, 64, 7, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> anomaly -= val, 512, 64, 7, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> anomaly /= val, 512, 64, 7, 58); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> pollution -= val, 16, 1, 25, 4); + addChangeNumberButton( + builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> pollution /= val, 16, 2, 25, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> anomaly -= val, 16, 1, 25, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> anomaly /= val, 16, 2, 25, 58); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> pollution += val, 16, 1, 133, 4); + addChangeNumberButton( + builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> pollution *= val, 16, 2, 133, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> anomaly += val, 16, 1, 133, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> anomaly *= val, 16, 2, 133, 58); + + addChangeNumberButton( + builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> pollution += val, 512, 64, 151, 4); + addChangeNumberButton( + builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> pollution *= val, 512, 64, 151, 22); + addChangeNumberButton( + builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> anomaly += val, 512, 64, 151, 40); + addChangeNumberButton( + builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> anomaly *= val, 512, 64, 151, 58); + } + + private void addChangeNumberButton( + ModularWindow.Builder builder, + IDrawable overlay, + Consumer<Integer> setter, + int changeNumberShift, + int changeNumber, + int xPos, + int yPos) { + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + setter.accept(clickData.shift ? changeNumberShift : changeNumber); + if (anomaly == Float.POSITIVE_INFINITY) { + anomaly = Float.MAX_VALUE; + } else if (anomaly == Float.NEGATIVE_INFINITY) { + anomaly = -Float.MAX_VALUE; + } + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) + .setSize(18, 18) + .setPos(xPos, yPos)); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java index a920d6db10..dc5398a254 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java @@ -2,28 +2,37 @@ package com.github.technus.tectech.thing.metaTileEntity.single; import static com.github.technus.tectech.thing.metaTileEntity.Textures.*; import static com.github.technus.tectech.util.CommonValues.TRANSFER_AT; +import static com.github.technus.tectech.util.CommonValues.VN; import static net.minecraft.util.StatCollector.translateToLocal; import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugPowerGenerator; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugPowerGenerator; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import java.util.function.Consumer; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -33,7 +42,7 @@ import net.minecraft.util.StatCollector; * Created by Tec on 23.03.2017. */ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_TieredMachineBlock - implements IConnectsToEnergyTunnel { + implements IConnectsToEnergyTunnel, IAddUIWidgets, IAddGregtechLogo { private static GT_RenderedTexture GENNY; private boolean LASER = false; public int EUT = 0, AMP = 0; @@ -94,16 +103,6 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_DebugPowerGenerator(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_DebugPowerGenerator(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { return false; } @@ -158,10 +157,7 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -298,4 +294,75 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie } } } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) + .setSize(17, 17) + .setPos(113, 56)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setSize(90, 72) + .setPos(43, 4)) + .widget(TextWidget.dynamicString(() -> "EUT: " + EUT) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 8)) + .widget(TextWidget.dynamicString(() -> "TIER: " + VN[TT_Utility.getTier(Math.abs(EUT))]) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 16)) + .widget(TextWidget.dynamicString(() -> "AMP: " + AMP) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 24)) + .widget(TextWidget.dynamicString(() -> "SUM: " + (long) AMP * EUT) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 32)); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> EUT -= val, 512, 64, 7, 4); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> EUT /= val, 512, 64, 7, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> AMP -= val, 512, 64, 7, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, val -> AMP /= val, 512, 64, 7, 58); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> EUT -= val, 16, 1, 25, 4); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> EUT /= val, 16, 2, 25, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> AMP -= val, 16, 1, 25, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, val -> AMP /= val, 16, 2, 25, 58); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> EUT += val, 16, 1, 133, 4); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> EUT *= val, 16, 2, 133, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> AMP += val, 16, 1, 133, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> AMP *= val, 16, 2, 133, 58); + + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> EUT += val, 512, 64, 151, 4); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> EUT *= val, 512, 64, 151, 22); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> AMP += val, 512, 64, 151, 40); + addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> AMP *= val, 512, 64, 151, 58); + } + + private void addChangeNumberButton( + ModularWindow.Builder builder, + IDrawable overlay, + Consumer<Integer> setter, + int changeNumberShift, + int changeNumber, + int xPos, + int yPos) { + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + setter.accept(clickData.shift ? changeNumberShift : changeNumber); + producing = (long) AMP * EUT >= 0; + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) + .setSize(18, 18) + .setPos(xPos, yPos)); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index 0aeb9b853d..f7b4db02fd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java @@ -4,23 +4,31 @@ import static com.github.technus.tectech.thing.metaTileEntity.Textures.MACHINE_C import static net.minecraft.util.StatCollector.translateToLocal; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugStructureWriter; -import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugStructureWriter; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.TT_Utility; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; import com.gtnewhorizon.structurelib.structure.StructureUtility; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GT_UIInfos; +import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddGregtechLogo; +import gregtech.api.interfaces.modularui.IAddUIWidgets; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; +import java.util.function.Consumer; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -29,7 +37,8 @@ import net.minecraftforge.common.util.ForgeDirection; /** * Created by Tec on 23.03.2017. */ -public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock { +public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock + implements IAddUIWidgets, IAddGregtechLogo { private static GT_RenderedTexture MARK; public short[] numbers = new short[6]; public boolean size = false; @@ -78,16 +87,6 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_DebugStructureWriter(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_DebugStructureWriter(aPlayerInventory, aBaseMetaTileEntity); - } - - @Override public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { return false; } @@ -182,10 +181,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); return true; } @@ -226,4 +222,79 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti public String[] getInfoData() { return result; } + + @Override + public boolean useModularUI() { + return true; + } + + @Override + public void addGregTechLogo(ModularWindow.Builder builder) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY) + .setSize(17, 17) + .setPos(113, 56)); + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget(new DrawableWidget() + .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setSize(90, 72) + .setPos(43, 4)) + .widget(TextWidget.dynamicString(() -> size ? "Structure size" : "My position") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 8)) + .widget(TextWidget.dynamicString(() -> size ? "(Changing scan size)" : "(Moving origin)") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 16)) + .widget(TextWidget.dynamicString(() -> "A: " + numbers[size ? 3 : 0]) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 24)) + .widget(TextWidget.dynamicString(() -> "B: " + numbers[size ? 4 : 1]) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 32)) + .widget(TextWidget.dynamicString(() -> "C: " + numbers[size ? 5 : 2]) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 40)); + + addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, -512, -64, 7); + addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, -16, -1, 25); + addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, 16, 1, 133); + addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, 512, 16, 151); + } + + private void addChangeNumberButtons( + ModularWindow.Builder builder, IDrawable overlay, int addNumberShift, int addNumber, int xPos) { + addChangeNumberButton( + builder, overlay, val -> numbers[size ? 3 : 0] += val, addNumberShift, addNumber, xPos, 4); + addChangeNumberButton( + builder, overlay, val -> numbers[size ? 4 : 1] += val, addNumberShift, addNumber, xPos, 22); + addChangeNumberButton( + builder, overlay, val -> numbers[size ? 5 : 2] += val, addNumberShift, addNumber, xPos, 40); + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + size = !size; + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) + .setSize(18, 18) + .setPos(xPos, 58)); + } + + private void addChangeNumberButton( + ModularWindow.Builder builder, + IDrawable overlay, + Consumer<Integer> setter, + int changeNumberShift, + int changeNumber, + int xPos, + int yPos) { + builder.widget(new ButtonWidget() + .setOnClick((clickData, widget) -> { + setter.accept(clickData.shift ? changeNumberShift : changeNumber); + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) + .setSize(18, 18) + .setPos(xPos, yPos)); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java index 1a7048fed4..b628a1121f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java @@ -20,7 +20,6 @@ import gregtech.api.util.GT_Utility; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -74,16 +73,6 @@ public class GT_MetaTileEntity_OwnerDetector extends GT_MetaTileEntity_TieredMac } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return null; - } - - @Override public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { return false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java index a6abe44064..899ebc603c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java @@ -19,6 +19,7 @@ import com.google.common.collect.Multimap; import com.google.common.collect.MultimapBuilder; import com.gtnewhorizon.structurelib.util.Vec3Impl; import eu.usrv.yamcore.auxiliary.PlayerChatHelper; +import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -284,7 +285,7 @@ public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryB } catch (Exception e) { clientLocale = "en_US"; } - aBaseMetaTileEntity.openGUI(aPlayer); + GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); } return true; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_BuckConverter.java deleted file mode 100644 index 35950cc27c..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_BuckConverter.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_BuckConverter; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_BuckConverter extends GT_ContainerMetaTile_Machine { - public int EUT = 0, AMP = 0; - - public GT_Container_BuckConverter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_BuckConverter buck = (GT_MetaTileEntity_BuckConverter) mTileEntity.getMetaTileEntity(); - switch (aSlotIndex) { - case 0: - buck.EUT -= aShifthold == 1 ? 512 : 64; - break; - case 1: - buck.EUT /= aShifthold == 1 ? 512 : 64; - break; - case 2: - buck.AMP -= aShifthold == 1 ? 512 : 64; - break; - case 3: - buck.AMP /= aShifthold == 1 ? 512 : 64; - break; - case 4: - buck.EUT -= aShifthold == 1 ? 16 : 1; - break; - case 5: - buck.EUT /= aShifthold == 1 ? 16 : 2; - break; - case 6: - buck.AMP -= aShifthold == 1 ? 16 : 1; - break; - case 7: - buck.AMP /= aShifthold == 1 ? 16 : 2; - break; - case 8: - buck.EUT += aShifthold == 1 ? 512 : 64; - break; - case 9: - buck.EUT *= aShifthold == 1 ? 512 : 64; - break; - case 10: - buck.AMP += aShifthold == 1 ? 512 : 64; - break; - case 11: - buck.AMP *= aShifthold == 1 ? 512 : 64; - break; - case 12: - buck.EUT += aShifthold == 1 ? 16 : 1; - break; - case 13: - buck.EUT *= aShifthold == 1 ? 16 : 2; - break; - case 14: - buck.AMP += aShifthold == 1 ? 16 : 1; - break; - case 15: - buck.AMP *= aShifthold == 1 ? 16 : 2; - break; - default: - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - buck.getBaseMetaTileEntity().setActive((long) AMP * EUT >= 0); - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - - GT_MetaTileEntity_BuckConverter buck = (GT_MetaTileEntity_BuckConverter) mTileEntity.getMetaTileEntity(); - EUT = buck.EUT; - AMP = buck.AMP; - buck.getBaseMetaTileEntity().setActive((long) AMP * EUT >= 0); - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 100, EUT & 0xFFFF); - var1.sendProgressBarUpdate(this, 101, EUT >>> 16); - var1.sendProgressBarUpdate(this, 102, AMP & 0xFFFF); - var1.sendProgressBarUpdate(this, 103, AMP >>> 16); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - EUT = EUT & 0xFFFF0000 | par2; - break; - case 101: - EUT = EUT & 0xFFFF | par2 << 16; - break; - case 102: - AMP = AMP & 0xFFFF0000 | par2; - break; - case 103: - AMP = AMP & 0xFFFF | par2 << 16; - break; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java deleted file mode 100644 index 57eda3f1d5..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DataReader.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_Container_BasicTank; -import gregtech.api.gui.GT_Slot_Output; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; - -public class GT_Container_DataReader extends GT_Container_BasicTank { - public boolean mStuttering = false; - - public GT_Container_DataReader(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - // this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 0, 8, 63, false, true, 1)); - // this.addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 0, 26, 63, false, true, 1)); - // this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, 2, 107, 63)); - - int tStartIndex = ((GT_MetaTileEntity_BasicMachine) this.mTileEntity.getMetaTileEntity()).getInputSlot(); - this.addSlotToContainer(new Slot(this.mTileEntity, tStartIndex, 53, 153)); - - tStartIndex = ((GT_MetaTileEntity_BasicMachine) this.mTileEntity.getMetaTileEntity()).getOutputSlot(); - this.addSlotToContainer(new GT_Slot_Output(this.mTileEntity, tStartIndex, 107, 153)); - - this.addSlotToContainer(new Slot(this.mTileEntity, 1, 17, 153)); - // this.addSlotToContainer(new Slot(this.mTileEntity, 3, 125, 63)); - // this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex, 53, 63)); - } - - @Override - protected void bindPlayerInventory(InventoryPlayer aInventoryPlayer) { - int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 174 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 232)); - } - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { - this.mStuttering = ((GT_MetaTileEntity_BasicMachine) this.mTileEntity.getMetaTileEntity()).mStuttering; - - for (Object crafter : this.crafters) { - ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 102, this.mStuttering ? 1 : 0); - } - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) { - super.addCraftingToCrafters(par1ICrafting); - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - if (par1 == 102) { - this.mStuttering = par2 != 0; - } - } - - @Override - public int getSlotStartIndex() { - return 0; - } - - @Override - public int getShiftClickStartIndex() { - return 0; - } - - @Override - public int getSlotCount() { - return 3; - } - - @Override - public int getShiftClickSlotCount() { - return 1; - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java deleted file mode 100644 index 097464efe8..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugPollutor; -import com.github.technus.tectech.util.TT_Utility; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_DebugPollutor extends GT_ContainerMetaTile_Machine { - public int pollution; - public float anomaly; - private int anomalyInt; - - public GT_Container_DebugPollutor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_DebugPollutor dpg = (GT_MetaTileEntity_DebugPollutor) mTileEntity.getMetaTileEntity(); - switch (aSlotIndex) { - case 0: - dpg.pollution -= aShifthold == 1 ? 512 : 64; - break; - case 1: - dpg.pollution /= aShifthold == 1 ? 512 : 64; - break; - case 2: - dpg.anomaly -= aShifthold == 1 ? 512 : 64; - break; - case 3: - dpg.anomaly /= aShifthold == 1 ? 512 : 64; - break; - case 4: - dpg.pollution -= aShifthold == 1 ? 16 : 1; - break; - case 5: - dpg.pollution /= aShifthold == 1 ? 16 : 2; - break; - case 6: - dpg.anomaly -= aShifthold == 1 ? 16 : 1; - break; - case 7: - dpg.anomaly /= aShifthold == 1 ? 16 : 2; - break; - case 8: - dpg.pollution += aShifthold == 1 ? 512 : 64; - break; - case 9: - dpg.pollution *= aShifthold == 1 ? 512 : 64; - break; - case 10: - dpg.anomaly += aShifthold == 1 ? 512 : 64; - break; - case 11: - dpg.anomaly *= aShifthold == 1 ? 512 : 64; - break; - case 12: - dpg.pollution += aShifthold == 1 ? 16 : 1; - break; - case 13: - dpg.pollution *= aShifthold == 1 ? 16 : 2; - break; - case 14: - dpg.anomaly += aShifthold == 1 ? 16 : 1; - break; - case 15: - dpg.anomaly *= aShifthold == 1 ? 16 : 2; - break; - default: - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - if (dpg.anomaly == Float.POSITIVE_INFINITY) { - dpg.anomaly = Float.MAX_VALUE; - } else if (dpg.anomaly == Float.NEGATIVE_INFINITY) { - dpg.anomaly = -Float.MAX_VALUE; - } - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - - GT_MetaTileEntity_DebugPollutor dpg = (GT_MetaTileEntity_DebugPollutor) mTileEntity.getMetaTileEntity(); - pollution = dpg.pollution; - anomaly = dpg.anomaly; - anomalyInt = Float.floatToIntBits(anomaly); - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - TT_Utility.sendInteger(pollution, this, var1, 100); - TT_Utility.sendFloat(anomaly, this, var1, 102); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - case 101: - pollution = TT_Utility.receiveInteger(pollution, 100, par1, par2); - break; - case 102: - case 103: - anomaly = Float.intBitsToFloat(anomalyInt = TT_Utility.receiveInteger(anomalyInt, 102, par1, par2)); - break; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java deleted file mode 100644 index 3563334b7a..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPowerGenerator.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugPowerGenerator; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_DebugPowerGenerator extends GT_ContainerMetaTile_Machine { - public int EUT = 0, AMP = 0; - - public GT_Container_DebugPowerGenerator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_DebugPowerGenerator dpg = - (GT_MetaTileEntity_DebugPowerGenerator) mTileEntity.getMetaTileEntity(); - switch (aSlotIndex) { - case 0: - dpg.EUT -= aShifthold == 1 ? 512 : 64; - break; - case 1: - dpg.EUT /= aShifthold == 1 ? 512 : 64; - break; - case 2: - dpg.AMP -= aShifthold == 1 ? 512 : 64; - break; - case 3: - dpg.AMP /= aShifthold == 1 ? 512 : 64; - break; - case 4: - dpg.EUT -= aShifthold == 1 ? 16 : 1; - break; - case 5: - dpg.EUT /= aShifthold == 1 ? 16 : 2; - break; - case 6: - dpg.AMP -= aShifthold == 1 ? 16 : 1; - break; - case 7: - dpg.AMP /= aShifthold == 1 ? 16 : 2; - break; - case 8: - dpg.EUT += aShifthold == 1 ? 512 : 64; - break; - case 9: - dpg.EUT *= aShifthold == 1 ? 512 : 64; - break; - case 10: - dpg.AMP += aShifthold == 1 ? 512 : 64; - break; - case 11: - dpg.AMP *= aShifthold == 1 ? 512 : 64; - break; - case 12: - dpg.EUT += aShifthold == 1 ? 16 : 1; - break; - case 13: - dpg.EUT *= aShifthold == 1 ? 16 : 2; - break; - case 14: - dpg.AMP += aShifthold == 1 ? 16 : 1; - break; - case 15: - dpg.AMP *= aShifthold == 1 ? 16 : 2; - break; - default: - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - dpg.producing = (long) AMP * EUT >= 0; - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - - GT_MetaTileEntity_DebugPowerGenerator dpg = - (GT_MetaTileEntity_DebugPowerGenerator) mTileEntity.getMetaTileEntity(); - EUT = dpg.EUT; - AMP = dpg.AMP; - dpg.producing = (long) AMP * EUT >= 0; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 100, EUT & 0xFFFF); - var1.sendProgressBarUpdate(this, 101, EUT >>> 16); - var1.sendProgressBarUpdate(this, 102, AMP & 0xFFFF); - var1.sendProgressBarUpdate(this, 103, AMP >>> 16); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - switch (par1) { - case 100: - EUT = EUT & 0xFFFF0000 | par2; - break; - case 101: - EUT = EUT & 0xFFFF | par2 << 16; - break; - case 102: - AMP = AMP & 0xFFFF0000 | par2; - break; - case 103: - AMP = AMP & 0xFFFF | par2 << 16; - break; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugStructureWriter.java deleted file mode 100644 index f2fcf9108b..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugStructureWriter.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugStructureWriter; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_DebugStructureWriter extends GT_ContainerMetaTile_Machine { - public boolean size = false; - public short[] numbers = new short[6]; - - public GT_Container_DebugStructureWriter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_DebugStructureWriter dsw = - (GT_MetaTileEntity_DebugStructureWriter) mTileEntity.getMetaTileEntity(); - if (dsw.numbers == null) { - return null; - } - switch (aSlotIndex) { - case 0: - dsw.numbers[size ? 3 : 0] -= aShifthold == 1 ? 512 : 64; - return null; - case 1: - dsw.numbers[size ? 4 : 1] -= aShifthold == 1 ? 512 : 64; - return null; - case 2: - dsw.numbers[size ? 5 : 2] -= aShifthold == 1 ? 512 : 64; - return null; - case 4: - dsw.numbers[size ? 3 : 0] -= aShifthold == 1 ? 16 : 1; - return null; - case 5: - dsw.numbers[size ? 4 : 1] -= aShifthold == 1 ? 16 : 1; - return null; - case 6: - dsw.numbers[size ? 5 : 2] -= aShifthold == 1 ? 16 : 1; - return null; - case 8: - dsw.numbers[size ? 3 : 0] += aShifthold == 1 ? 512 : 64; - return null; - case 9: - dsw.numbers[size ? 4 : 1] += aShifthold == 1 ? 512 : 64; - return null; - case 10: - dsw.numbers[size ? 5 : 2] += aShifthold == 1 ? 512 : 64; - return null; - case 12: - dsw.numbers[size ? 3 : 0] += aShifthold == 1 ? 16 : 1; - return null; - case 13: - dsw.numbers[size ? 4 : 1] += aShifthold == 1 ? 16 : 1; - return null; - case 14: - dsw.numbers[size ? 5 : 2] += aShifthold == 1 ? 16 : 1; - return null; - case 3: - case 7: - case 11: - case 15: - dsw.size ^= true; - return null; - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - GT_MetaTileEntity_DebugStructureWriter dsw = - (GT_MetaTileEntity_DebugStructureWriter) mTileEntity.getMetaTileEntity(); - if (numbers != null) { - System.arraycopy(dsw.numbers, 0, numbers, 0, dsw.numbers.length); - } - size = dsw.size; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - if (numbers != null) { - var1.sendProgressBarUpdate(this, 100, numbers[0]); - var1.sendProgressBarUpdate(this, 101, numbers[1]); - var1.sendProgressBarUpdate(this, 102, numbers[2]); - var1.sendProgressBarUpdate(this, 103, numbers[3]); - var1.sendProgressBarUpdate(this, 104, numbers[4]); - var1.sendProgressBarUpdate(this, 105, numbers[5]); - } - var1.sendProgressBarUpdate(this, 106, size ? 1 : 0); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - if (par1 == 106) { - size = par2 == 1; - } else { - if (numbers != null && par1 >= 100 && par1 <= 105) { - numbers[par1 - 100] = (short) par2; - } - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java deleted file mode 100644 index 8aef833a1b..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_BuckConverter.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import static com.github.technus.tectech.util.CommonValues.VN; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_BuckConverter extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_BuckConverter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_BuckConverter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("Buck Converter", 46, 8, 16448255); - if (mContainer != null) { - GT_Container_BuckConverter buck = (GT_Container_BuckConverter) mContainer; - fontRendererObj.drawString("EUT: " + buck.EUT, 46, 24, 16448255); - fontRendererObj.drawString( - "TIER: " + VN[TT_Utility.getTier(buck.EUT < 0 ? -buck.EUT : buck.EUT)], 46, 32, 16448255); - fontRendererObj.drawString("AMP: " + buck.AMP, 46, 40, 16448255); - fontRendererObj.drawString("SUM: " + (long) buck.AMP * buck.EUT, 46, 48, 16448255); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java deleted file mode 100644 index d6f150d87e..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java +++ /dev/null @@ -1,294 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DataReader; -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; -import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine { - public final String mName; - public final String mNEI; - public final byte mProgressBarDirection; - public final byte mProgressBarAmount; - private ItemStack stack = null; - - public GT_GUIContainer_DataReader( - InventoryPlayer aInventoryPlayer, - IGregTechTileEntity aTileEntity, - String aName, - String aTextureFile, - String aNEI) { - this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1); - } - - public GT_GUIContainer_DataReader( - InventoryPlayer aInventoryPlayer, - IGregTechTileEntity aTileEntity, - String aName, - String aTextureFile, - String aNEI, - byte aProgressBarDirection, - byte aProgressBarAmount) { - super( - new GT_Container_DataReader(aInventoryPlayer, aTileEntity), - "gregtech:textures/gui/basicmachines/" + aTextureFile); - this.mProgressBarDirection = aProgressBarDirection; - this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount); - this.mName = aName; - this.mNEI = aNEI; - ySize = 256; - } - - @Override - public void drawScreen(int mouseX, int mouseY, float par3) { - super.drawScreen(mouseX, mouseY, par3); - if (mContainer != null) { - if (mContainer.mTileEntity != null - && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { - GT_MetaTileEntity_DataReader reader = - (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); - renderDataTooltips(mouseX, mouseY, reader.mTier); - } - } - } - - protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - if (mContainer != null) { - if (mContainer.mTileEntity != null - && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { - GT_MetaTileEntity_DataReader reader = - (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); - if (renderDataFG(mouseX, mouseY, reader.mTier)) { - return; - } - } - } - fontRendererObj.drawString(mName, 7, 8, 0xfafaff); - } - - protected void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY) { - super.drawGuiContainerBackgroundLayer(par1, mouseX, mouseY); - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - if (this.mContainer != null) { - if (((GT_Container_DataReader) this.mContainer).mStuttering) { - this.drawTexturedModalRect(x + 127, y + 152, 176, 54, 18, 18); - } - - if (this.mContainer.mMaxProgressTime > 0) { - int tSize = this.mProgressBarDirection < 2 ? 20 : 18; - int tProgress = Math.max( - 1, - Math.min( - tSize * this.mProgressBarAmount, - (this.mContainer.mProgressTime > 0 ? 1 : 0) - + this.mContainer.mProgressTime - * tSize - * this.mProgressBarAmount - / this.mContainer.mMaxProgressTime)) - % (tSize + 1); - switch (this.mProgressBarDirection) { - case 0: - this.drawTexturedModalRect(x + 78, y + 152, 176, 0, tProgress, 18); - break; - case 1: - this.drawTexturedModalRect(x + 78 + 20 - tProgress, y + 152, 196 - tProgress, 0, tProgress, 18); - break; - case 2: - this.drawTexturedModalRect(x + 78, y + 152, 176, 0, 20, tProgress); - break; - case 3: - this.drawTexturedModalRect( - x + 78, y + 152 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress); - break; - case 4: - tProgress = 20 - tProgress; - this.drawTexturedModalRect(x + 78, y + 152, 176, 0, tProgress, 18); - break; - case 5: - tProgress = 20 - tProgress; - this.drawTexturedModalRect(x + 78 + 20 - tProgress, y + 152, 196 - tProgress, 0, tProgress, 18); - break; - case 6: - tProgress = 18 - tProgress; - this.drawTexturedModalRect(x + 78, y + 152, 176, 0, 20, tProgress); - break; - case 7: - tProgress = 18 - tProgress; - this.drawTexturedModalRect( - x + 78, y + 152 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress); - } - } - } - if (mContainer != null) { - if (mContainer.mTileEntity != null - && mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DataReader) { - GT_MetaTileEntity_DataReader reader = - (GT_MetaTileEntity_DataReader) mContainer.mTileEntity.getMetaTileEntity(); - renderDataBG(reader.getStackInSlot(reader.getOutputSlot()), mouseX, mouseY, x, y, reader.mTier); - } - } - } - - private void renderDataBG(ItemStack thing, int mouseX, int mouseY, int x, int y, byte mTier) { - if (thing != null) { - for (GT_MetaTileEntity_DataReader.IDataRender render : - GT_MetaTileEntity_DataReader.getRenders(new TT_Utility.ItemStack_NoNBT(thing))) { - if (render.canRender(thing, mTier)) { - if (!GT_Utility.areStacksEqual(stack, thing, false)) { - render.initRender(thing); - } - render.renderBackgroundOverlay(thing, mouseX, mouseY, x, y, this); - break; - } - } - } - stack = thing; - } - - private boolean renderDataFG(int mouseX, int mouseY, byte mTier) { - if (stack == null) { - return false; - } - for (GT_MetaTileEntity_DataReader.IDataRender render : - GT_MetaTileEntity_DataReader.getRenders(new TT_Utility.ItemStack_NoNBT(stack))) { - if (render.canRender(stack, mTier)) { - render.renderForeground(stack, mouseX, mouseY, this, fontRendererObj); - return true; - } - } - return false; - } - - private boolean renderDataTooltips(int mouseX, int mouseY, byte mTier) { - if (stack == null) { - return false; - } - for (GT_MetaTileEntity_DataReader.IDataRender render : - GT_MetaTileEntity_DataReader.getRenders(new TT_Utility.ItemStack_NoNBT(stack))) { - if (render.canRender(stack, mTier)) { - render.renderTooltips(stack, mouseX, mouseY, this); - return true; - } - } - return false; - } - - public void renderItemSimple(GT_Slot_Holo slot, ItemStack itemStack) { - int x = slot.xDisplayPosition; - int y = slot.yDisplayPosition; - this.zLevel = 100.0F; - itemRender.zLevel = 100.0F; - - if (itemStack == null) { - IIcon iicon = slot.getBackgroundIconIndex(); - - if (iicon != null) { - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); // Forge: Blending needs to be enabled for this. - this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); - this.drawTexturedModelRectFromIcon(x, y, iicon, 16, 16); - GL11.glDisable(GL11.GL_BLEND); // Forge: And clean that up - GL11.glEnable(GL11.GL_LIGHTING); - } - } - GL11.glEnable(GL11.GL_DEPTH_TEST); - itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemStack, x, y); - itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemStack, x, y); - - itemRender.zLevel = 0.0F; - this.zLevel = 0.0F; - } - - public void renderTooltipSimple(int mouseX, int mouseY, GT_Slot_Holo slot, ItemStack itemStack) { - int x = slot.xDisplayPosition + (width - xSize) / 2; - int y = slot.yDisplayPosition + (height - ySize) / 2; - if (mouseX >= x && mouseY >= y && mouseX <= x + 16 && mouseY <= y + 16) { - List strings = itemStack.getTooltip(Minecraft.getMinecraft().thePlayer, false); - if (strings.size() > 0) { - strings.set(0, itemStack.getRarity().rarityColor + (String) strings.get(0)); - } - hoveringText(strings, mouseX, mouseY, fontRendererObj); - } - } - - private void hoveringText(List strings, int x, int y, FontRenderer font) { - if (!strings.isEmpty()) { - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - // RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - int k = 0; - - for (Object aP_146283_1_ : strings) { - String s = (String) aP_146283_1_; - int l = font.getStringWidth(s); - - if (l > k) { - k = l; - } - } - - int x2 = x + 12; - int y2 = y - 12; - int i1 = 8; - - if (strings.size() > 1) { - i1 += 2 + (strings.size() - 1) * 10; - } - - if (x2 + k > this.width) { - x2 -= 28 + k; - } - - if (y2 + i1 + 6 > this.height) { - y2 = this.height - i1 - 6; - } - - // this.zLevel = 300.0F; - // itemRender.zLevel = 300.0F; - int j1 = 0xf0001040; // bg - this.drawGradientRect(x2 - 3, y2 - 4, x2 + k + 3, y2 - 3, j1, j1); - this.drawGradientRect(x2 - 3, y2 + i1 + 3, x2 + k + 3, y2 + i1 + 4, j1, j1); - this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 + i1 + 3, j1, j1); - this.drawGradientRect(x2 - 4, y2 - 3, x2 - 3, y2 + i1 + 3, j1, j1); - this.drawGradientRect(x2 + k + 3, y2 - 3, x2 + k + 4, y2 + i1 + 3, j1, j1); - int k1 = 0x500040ff; // border bright - int l1 = (k1 & 0xfefefe) >> 1 | k1 & 0xff000000; // border dark??? - this.drawGradientRect(x2 - 3, y2 - 3 + 1, x2 - 3 + 1, y2 + i1 + 3 - 1, k1, l1); - this.drawGradientRect(x2 + k + 2, y2 - 3 + 1, x2 + k + 3, y2 + i1 + 3 - 1, k1, l1); - this.drawGradientRect(x2 - 3, y2 - 3, x2 + k + 3, y2 - 3 + 1, k1, k1); - this.drawGradientRect(x2 - 3, y2 + i1 + 2, x2 + k + 3, y2 + i1 + 3, l1, l1); - - for (int i2 = 0; i2 < strings.size(); ++i2) { - String s1 = (String) strings.get(i2); - font.drawStringWithShadow(s1, x2, y2, -1); - - if (i2 == 0) { - y2 += 2; - } - - y2 += 10; - } - - // this.zLevel = 0.0F; - // itemRender.zLevel = 0.0F; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - // RenderHelper.enableStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - } - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPollutor.java deleted file mode 100644 index a754412eb6..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPollutor.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_DebugPollutor extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_DebugPollutor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_DebugPollutor(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("Pollutor", 46, 8, 16448255); - if (mContainer != null) { - GT_Container_DebugPollutor dpg = (GT_Container_DebugPollutor) mContainer; - fontRendererObj.drawString("Pollution: " + dpg.pollution, 46, 24, 16448255); - fontRendererObj.drawString("Anomaly: " + dpg.anomaly, 46, 32, 16448255); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java deleted file mode 100644 index e0990fa49c..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPowerGenerator.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import static com.github.technus.tectech.util.CommonValues.VN; -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import com.github.technus.tectech.util.TT_Utility; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_DebugPowerGenerator extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_DebugPowerGenerator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_DebugPowerGenerator(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("PowerThing", 46, 8, 16448255); - if (mContainer != null) { - GT_Container_DebugPowerGenerator dpg = (GT_Container_DebugPowerGenerator) mContainer; - fontRendererObj.drawString("EUT: " + dpg.EUT, 46, 24, 16448255); - fontRendererObj.drawString( - "TIER: " + VN[TT_Utility.getTier(dpg.EUT < 0 ? -dpg.EUT : dpg.EUT)], 46, 32, 16448255); - fontRendererObj.drawString("AMP: " + dpg.AMP, 46, 40, 16448255); - fontRendererObj.drawString("SUM: " + (long) dpg.AMP * dpg.EUT, 46, 48, 16448255); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java deleted file mode 100644 index f37327d457..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugStructureWriter.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.single.gui; - -import static gregtech.api.enums.GT_Values.RES_PATH_GUI; - -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; - -public class GT_GUIContainer_DebugStructureWriter extends GT_GUIContainerMetaTile_Machine { - public GT_GUIContainer_DebugStructureWriter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_DebugStructureWriter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("StructPrint", 46, 8, 16448255); - if (mContainer != null) { - GT_Container_DebugStructureWriter dsw = (GT_Container_DebugStructureWriter) mContainer; - if (dsw.numbers == null) { - return; - } - fontRendererObj.drawString(dsw.size ? "Structure size" : "My position", 46, 16, 16448255); - fontRendererObj.drawString(dsw.size ? "(Changing scan size)" : "(Moving origin)", 46, 24, 16448255); - fontRendererObj.drawString("A: " + dsw.numbers[dsw.size ? 3 : 0], 46, 32, 16448255); - fontRendererObj.drawString("B: " + dsw.numbers[dsw.size ? 4 : 1], 46, 40, 16448255); - fontRendererObj.drawString("C: " + dsw.numbers[dsw.size ? 5 : 2], 46, 48, 16448255); - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - super.drawGuiContainerBackgroundLayer(par1, par2, par3); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png b/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png Binary files differdeleted file mode 100644 index b754d2cfa5..0000000000 --- a/src/main/resources/assets/gregtech/textures/gui/Parametrizer.png +++ /dev/null diff --git a/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png b/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png Binary files differdeleted file mode 100644 index 3366ab1c14..0000000000 --- a/src/main/resources/assets/gregtech/textures/gui/ParametrizerAdv.png +++ /dev/null diff --git a/src/main/resources/assets/gregtech/textures/gui/ParametrizerText.png b/src/main/resources/assets/gregtech/textures/gui/ParametrizerText.png Binary files differdeleted file mode 100644 index da78ca5b21..0000000000 --- a/src/main/resources/assets/gregtech/textures/gui/ParametrizerText.png +++ /dev/null diff --git a/src/main/resources/assets/gregtech/textures/gui/Uncertainty.png b/src/main/resources/assets/gregtech/textures/gui/Uncertainty.png Binary files differdeleted file mode 100644 index 8afdd68ccc..0000000000 --- a/src/main/resources/assets/gregtech/textures/gui/Uncertainty.png +++ /dev/null diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png Binary files differdeleted file mode 100644 index 57a9b85ce9..0000000000 --- a/src/main/resources/assets/gregtech/textures/gui/basicmachines/dataReader.png +++ /dev/null diff --git a/src/main/resources/assets/gregtech/textures/gui/holder.png b/src/main/resources/assets/gregtech/textures/gui/holder.png Binary files differdeleted file mode 100644 index 421a4aee38..0000000000 --- a/src/main/resources/assets/gregtech/textures/gui/holder.png +++ /dev/null diff --git a/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png b/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png Binary files differdeleted file mode 100644 index e67f96e34e..0000000000 --- a/src/main/resources/assets/gregtech/textures/gui/multimachines/EMDisplay.png +++ /dev/null diff --git a/src/main/resources/assets/gregtech/textures/gui/rack.png b/src/main/resources/assets/gregtech/textures/gui/rack.png Binary files differdeleted file mode 100644 index e6ce2d6efd..0000000000 --- a/src/main/resources/assets/gregtech/textures/gui/rack.png +++ /dev/null diff --git a/src/main/resources/assets/tectech/textures/gui/background/screen_blue.png b/src/main/resources/assets/tectech/textures/gui/background/screen_blue.png Binary files differnew file mode 100644 index 0000000000..3f70db25e7 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/background/screen_blue.png diff --git a/src/main/resources/assets/tectech/textures/gui/background/screen_blue_parametrizer_txt.png b/src/main/resources/assets/tectech/textures/gui/background/screen_blue_parametrizer_txt.png Binary files differnew file mode 100644 index 0000000000..d35be3f276 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/background/screen_blue_parametrizer_txt.png diff --git a/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png b/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png Binary files differnew file mode 100644 index 0000000000..c2d191d9ce --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/button/standard_16x16.png diff --git a/src/main/resources/assets/tectech/textures/gui/button/standard_light_16x16.png b/src/main/resources/assets/tectech/textures/gui/button/standard_light_16x16.png Binary files differnew file mode 100644 index 0000000000..4071b19033 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/button/standard_light_16x16.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_off.png Binary files differnew file mode 100644 index 0000000000..d4307a802c --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_off.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_on.png Binary files differnew file mode 100644 index 0000000000..45f6bdf8ce --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/heat_on.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_0.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_0.png Binary files differnew file mode 100644 index 0000000000..585859a7b2 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_0.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_1.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_1.png Binary files differnew file mode 100644 index 0000000000..8d55a58ff5 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_1.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_c.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_c.png Binary files differnew file mode 100644 index 0000000000..d57bbee6e6 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_c.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_id.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_id.png Binary files differnew file mode 100644 index 0000000000..a7c940c97b --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_id.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_if.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_if.png Binary files differnew file mode 100644 index 0000000000..442c9161b7 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_if.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_s.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_s.png Binary files differnew file mode 100644 index 0000000000..a47abc5829 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_s.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_t.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_t.png Binary files differnew file mode 100644 index 0000000000..300c06cbf5 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_t.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_x.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_x.png Binary files differnew file mode 100644 index 0000000000..ab7dcec9bb --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/parametrizer_x.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_disabled.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_disabled.png Binary files differnew file mode 100644 index 0000000000..8edbc8ae1a --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_disabled.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_off.png Binary files differnew file mode 100644 index 0000000000..9887dfefd9 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_off.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_on.png Binary files differnew file mode 100644 index 0000000000..6021472296 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_pass_on.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_disabled.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_disabled.png Binary files differnew file mode 100644 index 0000000000..be40408929 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_disabled.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png Binary files differnew file mode 100644 index 0000000000..366fb5c8d7 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_off.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_on.png Binary files differnew file mode 100644 index 0000000000..1a033c8aec --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/power_switch_on.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_disabled.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_disabled.png Binary files differnew file mode 100644 index 0000000000..bc2b89a234 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_disabled.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_off.png Binary files differnew file mode 100644 index 0000000000..0d06a43a68 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_off.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_on.png Binary files differnew file mode 100644 index 0000000000..c5907fa3fd --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/safe_void_on.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/0.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/0.png Binary files differnew file mode 100644 index 0000000000..4beeaf609c --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/0.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/1.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/1.png Binary files differnew file mode 100644 index 0000000000..125ff851f0 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/1.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/10.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/10.png Binary files differnew file mode 100644 index 0000000000..6e28c85673 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/10.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/11.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/11.png Binary files differnew file mode 100644 index 0000000000..498246457d --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/11.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/12.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/12.png Binary files differnew file mode 100644 index 0000000000..f8c25b8625 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/12.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/13.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/13.png Binary files differnew file mode 100644 index 0000000000..f900fba9a2 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/13.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/14.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/14.png Binary files differnew file mode 100644 index 0000000000..a0ca048fa7 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/14.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/15.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/15.png Binary files differnew file mode 100644 index 0000000000..5f88156010 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/15.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/2.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/2.png Binary files differnew file mode 100644 index 0000000000..cfe3bc8922 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/2.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/3.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/3.png Binary files differnew file mode 100644 index 0000000000..cc04de0089 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/3.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/4.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/4.png Binary files differnew file mode 100644 index 0000000000..84d45df4c2 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/4.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/5.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/5.png Binary files differnew file mode 100644 index 0000000000..45f1196611 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/5.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/6.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/6.png Binary files differnew file mode 100644 index 0000000000..685991502e --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/6.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/7.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/7.png Binary files differnew file mode 100644 index 0000000000..8e9c590652 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/7.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/8.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/8.png Binary files differnew file mode 100644 index 0000000000..3fae38f805 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/8.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/9.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/9.png Binary files differnew file mode 100644 index 0000000000..477400df07 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_button/uncertainty/9.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_slot/mesh.png b/src/main/resources/assets/tectech/textures/gui/overlay_slot/mesh.png Binary files differnew file mode 100644 index 0000000000..a782e3dd7a --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_slot/mesh.png diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_slot/rack.png b/src/main/resources/assets/tectech/textures/gui/overlay_slot/rack.png Binary files differnew file mode 100644 index 0000000000..8abaf83263 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/overlay_slot/rack.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/heat_sink.png b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink.png Binary files differnew file mode 100644 index 0000000000..238409ace8 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/heat_sink_small.png b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink_small.png Binary files differnew file mode 100644 index 0000000000..28ac50bdc0 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink_small.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_blank.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_blank.png Binary files differnew file mode 100644 index 0000000000..bcd4f367d9 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/parameter_blank.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_blue.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_blue.png Binary files differnew file mode 100644 index 0000000000..3bb337dcf9 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/parameter_blue.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_cyan.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_cyan.png Binary files differnew file mode 100644 index 0000000000..1595bfde06 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/parameter_cyan.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_gray.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_gray.png Binary files differnew file mode 100644 index 0000000000..685bcd0c4a --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/parameter_gray.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_green.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_green.png Binary files differnew file mode 100644 index 0000000000..4464db4ef9 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/parameter_green.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_orange.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_orange.png Binary files differnew file mode 100644 index 0000000000..8838c9b61b --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/parameter_orange.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/parameter_red.png b/src/main/resources/assets/tectech/textures/gui/picture/parameter_red.png Binary files differnew file mode 100644 index 0000000000..d934b38063 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/parameter_red.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/rack_large.png b/src/main/resources/assets/tectech/textures/gui/picture/rack_large.png Binary files differnew file mode 100644 index 0000000000..b57e9267aa --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/rack_large.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo.png b/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo.png Binary files differnew file mode 100644 index 0000000000..704d04c26d --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo_dark.png b/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo_dark.png Binary files differnew file mode 100644 index 0000000000..bf12f0ccdb --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/tectech_logo_dark.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/indicator.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/indicator.png Binary files differnew file mode 100644 index 0000000000..fc56d4663d --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/indicator.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_0.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_0.png Binary files differnew file mode 100644 index 0000000000..a5b0d20b38 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_0.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_1.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_1.png Binary files differnew file mode 100644 index 0000000000..39ec7d8ef0 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_1.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_2.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_2.png Binary files differnew file mode 100644 index 0000000000..b6a26cd8b1 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_2.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_3.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_3.png Binary files differnew file mode 100644 index 0000000000..4bc12814a4 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_3.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_4.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_4.png Binary files differnew file mode 100644 index 0000000000..c4e0f07e22 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_4.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_5.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_5.png Binary files differnew file mode 100644 index 0000000000..1dce4d241d --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_5.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_6.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_6.png Binary files differnew file mode 100644 index 0000000000..17c55cb05d --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_6.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_7.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_7.png Binary files differnew file mode 100644 index 0000000000..0d25fffa61 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_7.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_8.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_8.png Binary files differnew file mode 100644 index 0000000000..f7c4d01ff6 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/invalid_8.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor.png Binary files differnew file mode 100644 index 0000000000..2510a1a99c --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor_multimachine.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor_multimachine.png Binary files differnew file mode 100644 index 0000000000..b5d1afe3b8 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/monitor_multimachine.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/selected.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/selected.png Binary files differnew file mode 100644 index 0000000000..3837244126 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/selected.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_0.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_0.png Binary files differnew file mode 100644 index 0000000000..aa0d038e86 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_0.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_1.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_1.png Binary files differnew file mode 100644 index 0000000000..66ef4ee2af --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_1.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_2.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_2.png Binary files differnew file mode 100644 index 0000000000..bffac90814 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_2.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_3.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_3.png Binary files differnew file mode 100644 index 0000000000..1c66b00bc1 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_3.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_4.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_4.png Binary files differnew file mode 100644 index 0000000000..17a5f107d4 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_4.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_5.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_5.png Binary files differnew file mode 100644 index 0000000000..68617d1f96 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_5.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_6.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_6.png Binary files differnew file mode 100644 index 0000000000..0ea0bddaed --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_6.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_7.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_7.png Binary files differnew file mode 100644 index 0000000000..1801437459 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_7.png diff --git a/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_8.png b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_8.png Binary files differnew file mode 100644 index 0000000000..89181e29e9 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/gui/picture/uncertainty/valid_8.png |