Work on NEI module
This commit is contained in:
parent
a40ab961c6
commit
3b99d376a4
7 changed files with 30 additions and 27 deletions
|
@ -31,12 +31,14 @@ public class GuiProgress extends GuiElement
|
|||
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||
{
|
||||
mc.renderEngine.bindTexture(RESOURCE);
|
||||
|
||||
if(handler.isActive())
|
||||
{
|
||||
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, type.textureX, type.textureY, type.width, type.height);
|
||||
int displayInt = (int)(handler.getProgress() * (type.width-2*innerOffsetX));
|
||||
guiObj.drawTexturedRect(guiWidth + xLocation + innerOffsetX, guiHeight + yLocation, type.textureX + type.width + innerOffsetX, type.textureY, displayInt, type.height);
|
||||
}
|
||||
|
||||
mc.renderEngine.bindTexture(defaultLocation);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,12 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
|
|||
public abstract Set<Entry<AdvancedInput, ItemStack>> getRecipes();
|
||||
|
||||
public abstract List<ItemStack> getFuelStacks(Gas gasType);
|
||||
|
||||
@Override
|
||||
public void addGuiElements()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int i)
|
||||
|
@ -99,6 +105,12 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "mekanism:gui/GuiAdvancedMachine.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients)
|
||||
|
@ -221,12 +233,6 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
|
|||
return super.mouseClicked(gui, button, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addGuiElements()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
|
||||
{
|
||||
public List<ItemStack> fuelStacks;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package mekanism.client.nei;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.changeTexture;
|
||||
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||
import static codechicken.lib.gui.GuiDraw.drawString;
|
||||
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.Map;
|
||||
|
@ -18,13 +18,19 @@ import codechicken.nei.NEIServerUtils;
|
|||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
public abstract class ChanceMachineRecipeHandler extends TemplateRecipeHandler
|
||||
public abstract class ChanceMachineRecipeHandler extends BaseRecipeHandler
|
||||
{
|
||||
private int ticksPassed;
|
||||
|
||||
public abstract String getRecipeId();
|
||||
|
||||
public abstract Set<Entry<ItemStack, ChanceOutput>> getRecipes();
|
||||
|
||||
@Override
|
||||
public void addGuiElements()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int i)
|
||||
|
@ -93,6 +99,12 @@ public abstract class ChanceMachineRecipeHandler extends TemplateRecipeHandler
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "mekanism:gui/GuiAdvancedMachine.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient)
|
||||
|
|
|
@ -58,6 +58,7 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler
|
|||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
changeTexture(getGuiTexture());
|
||||
drawTexturedModalRect(12, 0, 28, 5, 144, 68);
|
||||
|
||||
for(GuiElement e : guiElements)
|
||||
{
|
||||
e.renderBackground(0, 0, -16, -5);
|
||||
|
|
|
@ -37,12 +37,6 @@ public class OsmiumCompressorRecipeHandler extends AdvancedMachineRecipeHandler
|
|||
return Recipe.OSMIUM_COMPRESSOR.get().entrySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "mekanism:gui/GuiCompressor.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getFuelStacks(Gas gasType)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ import mekanism.common.recipe.RecipeHandler.Recipe;
|
|||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
public class PrecisionSawmillRecipeHandler extends ChanceMachineRecipeHandler
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public String getRecipeName()
|
||||
{
|
||||
|
@ -32,12 +32,6 @@ public class PrecisionSawmillRecipeHandler extends ChanceMachineRecipeHandler
|
|||
return Recipe.PRECISION_SAWMILL.get().entrySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "mekanism:gui/GuiPrecisionSawmill.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getGuiClass()
|
||||
{
|
||||
|
|
|
@ -39,12 +39,6 @@ public class PurificationChamberRecipeHandler extends AdvancedMachineRecipeHandl
|
|||
return Recipe.PURIFICATION_CHAMBER.get().entrySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture()
|
||||
{
|
||||
return "mekanism:gui/GuiPurificationChamber.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getFuelStacks(Gas gasType)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue