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)
|
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(RESOURCE);
|
mc.renderEngine.bindTexture(RESOURCE);
|
||||||
|
|
||||||
if(handler.isActive())
|
if(handler.isActive())
|
||||||
{
|
{
|
||||||
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, type.textureX, type.textureY, type.width, type.height);
|
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, type.textureX, type.textureY, type.width, type.height);
|
||||||
int displayInt = (int)(handler.getProgress() * (type.width-2*innerOffsetX));
|
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);
|
guiObj.drawTexturedRect(guiWidth + xLocation + innerOffsetX, guiHeight + yLocation, type.textureX + type.width + innerOffsetX, type.textureY, displayInt, type.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
mc.renderEngine.bindTexture(defaultLocation);
|
mc.renderEngine.bindTexture(defaultLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,12 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
|
||||||
|
|
||||||
public abstract List<ItemStack> getFuelStacks(Gas gasType);
|
public abstract List<ItemStack> getFuelStacks(Gas gasType);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addGuiElements()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBackground(int i)
|
public void drawBackground(int i)
|
||||||
{
|
{
|
||||||
|
@ -100,6 +106,12 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGuiTexture()
|
||||||
|
{
|
||||||
|
return "mekanism:gui/GuiAdvancedMachine.png";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadUsageRecipes(String inputId, Object... ingredients)
|
public void loadUsageRecipes(String inputId, Object... ingredients)
|
||||||
{
|
{
|
||||||
|
@ -221,12 +233,6 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
|
||||||
return super.mouseClicked(gui, button, recipe);
|
return super.mouseClicked(gui, button, recipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addGuiElements()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
|
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
|
||||||
{
|
{
|
||||||
public List<ItemStack> fuelStacks;
|
public List<ItemStack> fuelStacks;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package mekanism.client.nei;
|
package mekanism.client.nei;
|
||||||
|
|
||||||
import static codechicken.lib.gui.GuiDraw.changeTexture;
|
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.drawString;
|
||||||
|
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||||
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -18,7 +18,7 @@ import codechicken.nei.NEIServerUtils;
|
||||||
import codechicken.nei.PositionedStack;
|
import codechicken.nei.PositionedStack;
|
||||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||||
|
|
||||||
public abstract class ChanceMachineRecipeHandler extends TemplateRecipeHandler
|
public abstract class ChanceMachineRecipeHandler extends BaseRecipeHandler
|
||||||
{
|
{
|
||||||
private int ticksPassed;
|
private int ticksPassed;
|
||||||
|
|
||||||
|
@ -26,6 +26,12 @@ public abstract class ChanceMachineRecipeHandler extends TemplateRecipeHandler
|
||||||
|
|
||||||
public abstract Set<Entry<ItemStack, ChanceOutput>> getRecipes();
|
public abstract Set<Entry<ItemStack, ChanceOutput>> getRecipes();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addGuiElements()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBackground(int i)
|
public void drawBackground(int i)
|
||||||
{
|
{
|
||||||
|
@ -94,6 +100,12 @@ public abstract class ChanceMachineRecipeHandler extends TemplateRecipeHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGuiTexture()
|
||||||
|
{
|
||||||
|
return "mekanism:gui/GuiAdvancedMachine.png";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadUsageRecipes(ItemStack ingredient)
|
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);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
changeTexture(getGuiTexture());
|
changeTexture(getGuiTexture());
|
||||||
drawTexturedModalRect(12, 0, 28, 5, 144, 68);
|
drawTexturedModalRect(12, 0, 28, 5, 144, 68);
|
||||||
|
|
||||||
for(GuiElement e : guiElements)
|
for(GuiElement e : guiElements)
|
||||||
{
|
{
|
||||||
e.renderBackground(0, 0, -16, -5);
|
e.renderBackground(0, 0, -16, -5);
|
||||||
|
|
|
@ -37,12 +37,6 @@ public class OsmiumCompressorRecipeHandler extends AdvancedMachineRecipeHandler
|
||||||
return Recipe.OSMIUM_COMPRESSOR.get().entrySet();
|
return Recipe.OSMIUM_COMPRESSOR.get().entrySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGuiTexture()
|
|
||||||
{
|
|
||||||
return "mekanism:gui/GuiCompressor.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getFuelStacks(Gas gasType)
|
public List<ItemStack> getFuelStacks(Gas gasType)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,12 +32,6 @@ public class PrecisionSawmillRecipeHandler extends ChanceMachineRecipeHandler
|
||||||
return Recipe.PRECISION_SAWMILL.get().entrySet();
|
return Recipe.PRECISION_SAWMILL.get().entrySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGuiTexture()
|
|
||||||
{
|
|
||||||
return "mekanism:gui/GuiPrecisionSawmill.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class getGuiClass()
|
public Class getGuiClass()
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,12 +39,6 @@ public class PurificationChamberRecipeHandler extends AdvancedMachineRecipeHandl
|
||||||
return Recipe.PURIFICATION_CHAMBER.get().entrySet();
|
return Recipe.PURIFICATION_CHAMBER.get().entrySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getGuiTexture()
|
|
||||||
{
|
|
||||||
return "mekanism:gui/GuiPurificationChamber.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getFuelStacks(Gas gasType)
|
public List<ItemStack> getFuelStacks(Gas gasType)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue