diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2016-04-11 19:44:54 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2016-04-11 19:44:54 +0300 |
| commit | 05c78126859231a68e199dc34613689bd0978e2f (patch) | |
| tree | 050bea104a18c72905095d29f31bec2935a27a24 /ihl/nei_integration/ChemicalReactorRecipeHandler.java | |
Initial commit
Diffstat (limited to 'ihl/nei_integration/ChemicalReactorRecipeHandler.java')
| -rw-r--r-- | ihl/nei_integration/ChemicalReactorRecipeHandler.java | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/ihl/nei_integration/ChemicalReactorRecipeHandler.java b/ihl/nei_integration/ChemicalReactorRecipeHandler.java new file mode 100644 index 0000000..161bdfe --- /dev/null +++ b/ihl/nei_integration/ChemicalReactorRecipeHandler.java @@ -0,0 +1,140 @@ +package ihl.nei_integration;
+
+import java.awt.Rectangle;
+import java.util.Map;
+
+import org.lwjgl.opengl.GL11;
+
+import codechicken.lib.gui.GuiDraw;
+import ihl.processing.chemistry.ChemicalReactorGui;
+import ihl.processing.chemistry.ChemicalReactorTileEntity;
+import ihl.recipes.UniversalRecipeInput;
+import ihl.recipes.UniversalRecipeOutput;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.util.StatCollector;
+
+
+public class ChemicalReactorRecipeHandler extends MachineRecipeHandler
+{
+ @Override
+ public Class <? extends GuiContainer > getGuiClass()
+ {
+ return ChemicalReactorGui.class;
+ }
+
+ @Override
+ protected int[] getInputPosX()
+ {
+ return new int[]{104-5,122-5};
+ }
+
+ @Override
+ protected int[] getInputPosY()
+ {
+ return new int[]{15-11};
+ }
+
+ @Override
+ protected int[] getFluidInputPosX()
+ {
+ return new int[]{42-5,60-5};
+ }
+
+ @Override
+ protected int[] getFluidInputPosY()
+ {
+ return new int[]{15-11};
+ }
+
+ @Override
+ protected int[] getOutputPosX()
+ {
+ return new int[]{104-5,122-5};
+ }
+
+ @Override
+ protected int[] getFluidOutputPosX()
+ {
+ return new int[]{42-5,60-5};
+ }
+
+ @Override
+ protected int[] getOutputPosY()
+ {
+ return new int[]{51-11};
+ }
+
+ @Override
+ protected int[] getFluidOutputPosY()
+ {
+ return new int[]{51-11};
+ }
+
+ @Override
+ public String getRecipeName()
+ {
+ return "Chemical reactor";
+ }
+
+ @Override
+ public String getRecipeId()
+ {
+ return "ihl.chemicalReactor";
+ }
+
+ @Override
+ public String getGuiTexture()
+ {
+ return "ihl:textures/gui/GUIChemicalReactor.png";
+ }
+
+ @Override
+ public String getOverlayIdentifier()
+ {
+ return "chemicalReactor";
+ }
+
+ @Override
+ public void loadTransferRects()
+ {
+ this.transferRects.add(new RecipeTransferRect(new Rectangle(103-5,32-10, 36, 18), this.getRecipeId(), new Object[0]));
+ }
+
+ @Override
+ public void drawExtras(int recipeNumber)
+ {
+ super.drawExtras(recipeNumber);
+ MachineRecipeHandler.CachedIORecipe recipe = (CachedIORecipe) this.arecipes.get(recipeNumber);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GuiDraw.drawTexturedModalRect(103-18-5, 52-11, 246, 226+6*(this.ticks%4),10,6);
+ if(recipe.specialConditions)
+ {
+ GuiDraw.drawTexturedModalRect(0, 32-11, 0, 166,134,18);
+ GuiDraw.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("ihl.use_with_cryogenic_distiller"), 0, 27, 16777215);
+ }
+ }
+
+ @Override
+ public void drawBackground(int i)
+ {
+ super.drawBackground(i);
+ GuiDraw.drawTexturedModalRect(41-5, 14-11, 59, 14, 18, 18);
+ GuiDraw.drawTexturedModalRect(41-5, 50-11, 59, 50, 18, 18);
+ }
+
+ @Override
+ public Map<UniversalRecipeInput, UniversalRecipeOutput> getRecipeList()
+ {
+ return ChemicalReactorTileEntity.getRecipes();
+ }
+
+ private int getFrameY(int number)
+ {
+ return (number % 10) * 24 + 14;
+ }
+
+ private int getFrameX(int number)
+ {
+ return (number / 10) * 24 + 176;
+ }
+}
|
