Advertisement
Guest User

Untitled

a guest
Jul 5th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. package miscutil.core.xmod.gregtech.api.gui;
  2.  
  3.  
  4. import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
  5. import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
  6. import miscutil.core.lib.CORE;
  7. import net.minecraft.entity.player.InventoryPlayer;
  8.  
  9.  
  10. public class GUI_IndustrialCentrifuge extends GT_GUIContainerMetaTile_Machine {
  11.  
  12. String mName = "";
  13. private short counter = 0;
  14.  
  15. public GUI_IndustrialCentrifuge(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
  16. super(new CONTAINER_IndustrialCentrifuge(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
  17. mName = aName;
  18. }
  19.  
  20. @Override
  21. protected void drawGuiContainerForegroundLayer(int par1, int par2) {
  22. fontRendererObj.drawString(mName, 10, 8, 16448255);
  23. if (counter >= 100){
  24. counter = 0;
  25. }
  26. else {
  27. counter++;
  28. }
  29. if (mContainer != null) {
  30. if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 1) != 0)
  31. fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
  32. if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 2) != 0)
  33. fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
  34. if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 4) != 0)
  35. fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
  36. if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 8) != 0)
  37. fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
  38. if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 32) != 0)
  39. fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
  40. if ((((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode & 64) != 0)
  41. fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
  42.  
  43. if (((CONTAINER_IndustrialCentrifuge) mContainer).mDisplayErrorCode == 0) {
  44. if (((CONTAINER_IndustrialCentrifuge) mContainer).mActive == 0) {
  45. fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
  46. fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
  47. fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
  48. } else {
  49. fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
  50. /*if (CORE.DEBUG){
  51. fontRendererObj.drawString("Debug Counter: "+counter, 10, 56, 16448255);
  52. }*/
  53. }
  54. }
  55. }
  56. }
  57.  
  58. @Override
  59. protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
  60. super.drawGuiContainerBackgroundLayer(par1, par2, par3);
  61. int x = (width - xSize) / 2;
  62. int y = (height - ySize) / 2;
  63. drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement