From 5c36612146a3c4733c9ca22099463a6fa3900bb2 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Sat, 14 Jun 2014 18:33:48 +0200 Subject: [PATCH] Updated NEI module to reflect new GUI changes, added PRC to RecipeHelper --- src/main/java/mekanism/api/RecipeHelper.java | 20 ++++++- .../gui/GuiAdvancedElectricMachine.java | 8 ++- .../mekanism/client/gui/GuiChanceMachine.java | 8 ++- .../gui/GuiChemicalInjectionChamber.java | 7 +++ .../java/mekanism/client/gui/GuiCombiner.java | 7 +++ .../java/mekanism/client/gui/GuiCrusher.java | 7 +++ .../client/gui/GuiElectricMachine.java | 8 ++- .../client/gui/GuiEnergizedSmelter.java | 7 +++ .../client/gui/GuiEnrichmentChamber.java | 7 +++ .../client/gui/GuiOsmiumCompressor.java | 7 +++ src/main/java/mekanism/client/gui/GuiPRC.java | 10 +++- .../java/mekanism/client/gui/GuiPowerBar.java | 52 +++++++++++++++--- .../client/gui/GuiPrecisionSawmill.java | 10 ++++ .../client/gui/GuiPurificationChamber.java | 7 +++ .../nei/AdvancedMachineRecipeHandler.java | 45 +++++++++++++--- .../nei/ChanceMachineRecipeHandler.java | 43 ++++++++++++--- ...ChemicalInjectionChamberRecipeHandler.java | 7 +++ .../client/nei/CombinerRecipeHandler.java | 7 +++ .../client/nei/CrusherRecipeHandler.java | 7 +++ .../nei/EnrichmentChamberRecipeHandler.java | 7 +++ .../client/nei/MachineRecipeHandler.java | 23 ++++---- .../nei/MetallurgicInfuserRecipeHandler.java | 53 ++++++++++++++----- .../client/nei/NEIMekanismConfig.java | 2 +- .../nei/OsmiumCompressorRecipeHandler.java | 7 +++ .../nei/PrecisionSawmillRecipeHandler.java | 7 +++ .../nei/PurificationChamberRecipeHandler.java | 7 +++ .../mekanism/common/recipe/RecipeHandler.java | 3 +- .../common/tile/TileEntityBasicMachine.java | 2 - .../TileEntityChemicalInjectionChamber.java | 6 --- .../common/tile/TileEntityCombiner.java | 6 --- .../common/tile/TileEntityCrusher.java | 7 --- .../tile/TileEntityEnergizedSmelter.java | 6 --- .../tile/TileEntityEnrichmentChamber.java | 6 --- .../tile/TileEntityOsmiumCompressor.java | 7 --- .../mekanism/common/tile/TileEntityPRC.java | 8 +-- .../tile/TileEntityPrecisionSawmill.java | 6 --- .../tile/TileEntityPurificationChamber.java | 6 --- .../resources/assets/mekanism/lang/en_US.lang | 2 +- 38 files changed, 336 insertions(+), 109 deletions(-) diff --git a/src/main/java/mekanism/api/RecipeHelper.java b/src/main/java/mekanism/api/RecipeHelper.java index 7ef8310d5..6e27c0cd5 100644 --- a/src/main/java/mekanism/api/RecipeHelper.java +++ b/src/main/java/mekanism/api/RecipeHelper.java @@ -207,7 +207,7 @@ public final class RecipeHelper } /** - * Add a Electrolytic Separator recipe. + * Add a Chemical Crystallizer recipe. * @param input - input GasStack * @param output - output ItemStack */ @@ -237,4 +237,22 @@ public final class RecipeHelper System.err.println("Error while adding recipe: " + e.getMessage()); } } + + /** + * Add a Pressurized Reaction Chamber recipe. + * @param input - input PressurizedReactants + * @param output - output PressurizedProducts + * @param extraEnergy - extra energy needed by the recipe + * @param ticks - amount of ticks it takes for this recipe to complete + */ + public static void addPRCRecipe(PressurizedReactants input, PressurizedProducts output, double extraEnergy, int ticks) + { + try { + Class recipeClass = Class.forName("mekanism.common.recipe.RecipeHandler"); + Method m = recipeClass.getMethod("addPRCRecipe", PressurizedReactants.class, PressurizedProducts.class, Double.TYPE, Integer.TYPE); + m.invoke(null, input, output); + } catch(Exception e) { + System.err.println("Error while adding recipe: " + e.getMessage()); + } + } } diff --git a/src/main/java/mekanism/client/gui/GuiAdvancedElectricMachine.java b/src/main/java/mekanism/client/gui/GuiAdvancedElectricMachine.java index 79c5668cf..495a66fbd 100644 --- a/src/main/java/mekanism/client/gui/GuiAdvancedElectricMachine.java +++ b/src/main/java/mekanism/client/gui/GuiAdvancedElectricMachine.java @@ -6,6 +6,7 @@ import mekanism.api.ListUtils; import mekanism.api.gas.GasStack; import mekanism.client.gui.GuiEnergyInfo.IInfoHandler; import mekanism.client.gui.GuiProgress.IProgressInfoHandler; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.client.gui.GuiSlot.SlotOverlay; import mekanism.client.gui.GuiSlot.SlotType; import mekanism.client.render.MekanismRenderer; @@ -54,7 +55,12 @@ public class GuiAdvancedElectricMachine extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37)); + }, getProgressType(), this, tileEntity.guiLocation, 77, 37)); + } + + public ProgressBar getProgressType() + { + return ProgressBar.BLUE; } @Override diff --git a/src/main/java/mekanism/client/gui/GuiChanceMachine.java b/src/main/java/mekanism/client/gui/GuiChanceMachine.java index 3e81cd96b..185acd9a0 100644 --- a/src/main/java/mekanism/client/gui/GuiChanceMachine.java +++ b/src/main/java/mekanism/client/gui/GuiChanceMachine.java @@ -5,6 +5,7 @@ import java.util.List; import mekanism.api.ListUtils; import mekanism.client.gui.GuiEnergyInfo.IInfoHandler; import mekanism.client.gui.GuiProgress.IProgressInfoHandler; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.client.gui.GuiSlot.SlotOverlay; import mekanism.client.gui.GuiSlot.SlotType; import mekanism.common.inventory.container.ContainerChanceMachine; @@ -51,7 +52,12 @@ public class GuiChanceMachine extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37)); + }, getProgressType(), this, tileEntity.guiLocation, 77, 37)); + } + + public ProgressBar getProgressType() + { + return ProgressBar.BLUE; } @Override diff --git a/src/main/java/mekanism/client/gui/GuiChemicalInjectionChamber.java b/src/main/java/mekanism/client/gui/GuiChemicalInjectionChamber.java index c97b1b496..127274263 100644 --- a/src/main/java/mekanism/client/gui/GuiChemicalInjectionChamber.java +++ b/src/main/java/mekanism/client/gui/GuiChemicalInjectionChamber.java @@ -1,5 +1,6 @@ package mekanism.client.gui; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.tile.TileEntityAdvancedElectricMachine; import net.minecraft.entity.player.InventoryPlayer; import cpw.mods.fml.relauncher.Side; @@ -12,4 +13,10 @@ public class GuiChemicalInjectionChamber extends GuiAdvancedElectricMachine { super(inventory, tentity); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.YELLOW; + } } diff --git a/src/main/java/mekanism/client/gui/GuiCombiner.java b/src/main/java/mekanism/client/gui/GuiCombiner.java index a5d002b28..fb6af5eb4 100644 --- a/src/main/java/mekanism/client/gui/GuiCombiner.java +++ b/src/main/java/mekanism/client/gui/GuiCombiner.java @@ -1,5 +1,6 @@ package mekanism.client.gui; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.tile.TileEntityAdvancedElectricMachine; import net.minecraft.entity.player.InventoryPlayer; import cpw.mods.fml.relauncher.Side; @@ -12,4 +13,10 @@ public class GuiCombiner extends GuiAdvancedElectricMachine { super(inventory, tentity); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.STONE; + } } diff --git a/src/main/java/mekanism/client/gui/GuiCrusher.java b/src/main/java/mekanism/client/gui/GuiCrusher.java index 0bc1d0493..4e04ab99d 100644 --- a/src/main/java/mekanism/client/gui/GuiCrusher.java +++ b/src/main/java/mekanism/client/gui/GuiCrusher.java @@ -1,5 +1,6 @@ package mekanism.client.gui; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.tile.TileEntityElectricMachine; import net.minecraft.entity.player.InventoryPlayer; import cpw.mods.fml.relauncher.Side; @@ -12,4 +13,10 @@ public class GuiCrusher extends GuiElectricMachine { super(inventory, tentity); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.CRUSH; + } } diff --git a/src/main/java/mekanism/client/gui/GuiElectricMachine.java b/src/main/java/mekanism/client/gui/GuiElectricMachine.java index a8c9beee0..4399b6848 100644 --- a/src/main/java/mekanism/client/gui/GuiElectricMachine.java +++ b/src/main/java/mekanism/client/gui/GuiElectricMachine.java @@ -5,6 +5,7 @@ import java.util.List; import mekanism.api.ListUtils; import mekanism.client.gui.GuiEnergyInfo.IInfoHandler; import mekanism.client.gui.GuiProgress.IProgressInfoHandler; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.client.gui.GuiSlot.SlotOverlay; import mekanism.client.gui.GuiSlot.SlotType; import mekanism.common.inventory.container.ContainerElectricMachine; @@ -51,7 +52,12 @@ public class GuiElectricMachine extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37)); + }, getProgressType(), this, tileEntity.guiLocation, 77, 37)); + } + + public ProgressBar getProgressType() + { + return ProgressBar.BLUE; } @Override diff --git a/src/main/java/mekanism/client/gui/GuiEnergizedSmelter.java b/src/main/java/mekanism/client/gui/GuiEnergizedSmelter.java index 9bf2e749e..70f0a7bb4 100644 --- a/src/main/java/mekanism/client/gui/GuiEnergizedSmelter.java +++ b/src/main/java/mekanism/client/gui/GuiEnergizedSmelter.java @@ -1,5 +1,6 @@ package mekanism.client.gui; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.tile.TileEntityElectricMachine; import net.minecraft.entity.player.InventoryPlayer; import cpw.mods.fml.relauncher.Side; @@ -12,4 +13,10 @@ public class GuiEnergizedSmelter extends GuiElectricMachine { super(inventory, tentity); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.GREEN; + } } diff --git a/src/main/java/mekanism/client/gui/GuiEnrichmentChamber.java b/src/main/java/mekanism/client/gui/GuiEnrichmentChamber.java index ebf4105a9..3807bc145 100644 --- a/src/main/java/mekanism/client/gui/GuiEnrichmentChamber.java +++ b/src/main/java/mekanism/client/gui/GuiEnrichmentChamber.java @@ -1,5 +1,6 @@ package mekanism.client.gui; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.tile.TileEntityElectricMachine; import net.minecraft.entity.player.InventoryPlayer; import cpw.mods.fml.relauncher.Side; @@ -12,4 +13,10 @@ public class GuiEnrichmentChamber extends GuiElectricMachine { super(inventory, tentity); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.BLUE; + } } diff --git a/src/main/java/mekanism/client/gui/GuiOsmiumCompressor.java b/src/main/java/mekanism/client/gui/GuiOsmiumCompressor.java index 33c90ca31..add0d4f92 100644 --- a/src/main/java/mekanism/client/gui/GuiOsmiumCompressor.java +++ b/src/main/java/mekanism/client/gui/GuiOsmiumCompressor.java @@ -1,5 +1,6 @@ package mekanism.client.gui; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.tile.TileEntityAdvancedElectricMachine; import net.minecraft.entity.player.InventoryPlayer; import cpw.mods.fml.relauncher.Side; @@ -12,4 +13,10 @@ public class GuiOsmiumCompressor extends GuiAdvancedElectricMachine { super(inventory, tentity); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.RED; + } } diff --git a/src/main/java/mekanism/client/gui/GuiPRC.java b/src/main/java/mekanism/client/gui/GuiPRC.java index 3e8e8a36c..066882683 100644 --- a/src/main/java/mekanism/client/gui/GuiPRC.java +++ b/src/main/java/mekanism/client/gui/GuiPRC.java @@ -16,6 +16,10 @@ import net.minecraftforge.fluids.FluidTank; import org.lwjgl.opengl.GL11; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public class GuiPRC extends GuiMekanism { public TileEntityPRC tileEntity; @@ -60,7 +64,7 @@ public class GuiPRC extends GuiMekanism { return tileEntity.getScaledProgress(); } - }, ProgressBar.MEDIUM, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 75, 37)); + }, getProgressType(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 75, 37)); } @Override @@ -90,4 +94,8 @@ public class GuiPRC extends GuiMekanism super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY); } + public ProgressBar getProgressType() + { + return ProgressBar.MEDIUM; + } } diff --git a/src/main/java/mekanism/client/gui/GuiPowerBar.java b/src/main/java/mekanism/client/gui/GuiPowerBar.java index 0e8fce8cb..efc03bc11 100644 --- a/src/main/java/mekanism/client/gui/GuiPowerBar.java +++ b/src/main/java/mekanism/client/gui/GuiPowerBar.java @@ -17,15 +17,51 @@ public class GuiPowerBar extends GuiElement private int height = 56; private int innerOffsetY = 2; - private TileEntityElectricBlock tileEntityElectric; + private TileEntityElectricBlock tileEntity; + private IPowerInfoHandler handler; public GuiPowerBar(IGuiWrapper gui, TileEntityElectricBlock tile, ResourceLocation def, int x, int y) { super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, def); - tileEntityElectric = tile; + + tileEntity = tile; + + handler = new IPowerInfoHandler() { + @Override + public String getTooltip() + { + return MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()); + } + + @Override + public double getLevel() + { + return tileEntity.getEnergy()/tileEntity.getMaxEnergy(); + } + }; + xLocation = x; yLocation = y; } + + public GuiPowerBar(IGuiWrapper gui, IPowerInfoHandler h, ResourceLocation def, int x, int y) + { + super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, def); + + handler = h; + xLocation = x; + yLocation = y; + } + + public static abstract class IPowerInfoHandler + { + public String getTooltip() + { + return null; + } + + public abstract double getLevel(); + } @Override public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight) @@ -33,8 +69,12 @@ public class GuiPowerBar extends GuiElement mc.renderEngine.bindTexture(RESOURCE); guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height); - int displayInt = tileEntityElectric.getScaledEnergyLevel(52) + innerOffsetY; - guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation + height - displayInt, 6, height - displayInt, width, displayInt); + + if(handler.getLevel() > 0) + { + int displayInt = (int)(handler.getLevel()*52) + innerOffsetY; + guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation + height - displayInt, 6, height - displayInt, width, displayInt); + } mc.renderEngine.bindTexture(defaultLocation); } @@ -44,9 +84,9 @@ public class GuiPowerBar extends GuiElement { mc.renderEngine.bindTexture(RESOURCE); - if(xAxis >= xLocation && xAxis <= xLocation + width && yAxis >= yLocation && yAxis <= yLocation + height) + if(handler.getTooltip() != null && xAxis >= xLocation && xAxis <= xLocation + width && yAxis >= yLocation && yAxis <= yLocation + height) { - displayTooltip(MekanismUtils.getEnergyDisplay(tileEntityElectric.getEnergy()), xAxis, yAxis); + displayTooltip(handler.getTooltip(), xAxis, yAxis); } mc.renderEngine.bindTexture(defaultLocation); diff --git a/src/main/java/mekanism/client/gui/GuiPrecisionSawmill.java b/src/main/java/mekanism/client/gui/GuiPrecisionSawmill.java index 0647eee75..0f3cdcff8 100644 --- a/src/main/java/mekanism/client/gui/GuiPrecisionSawmill.java +++ b/src/main/java/mekanism/client/gui/GuiPrecisionSawmill.java @@ -1,12 +1,22 @@ package mekanism.client.gui; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.tile.TileEntityChanceMachine; import net.minecraft.entity.player.InventoryPlayer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +@SideOnly(Side.CLIENT) public class GuiPrecisionSawmill extends GuiChanceMachine { public GuiPrecisionSawmill(InventoryPlayer inventory, TileEntityChanceMachine tentity) { super(inventory, tentity); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.PURPLE; + } } diff --git a/src/main/java/mekanism/client/gui/GuiPurificationChamber.java b/src/main/java/mekanism/client/gui/GuiPurificationChamber.java index 06585c5e3..337aa4e05 100644 --- a/src/main/java/mekanism/client/gui/GuiPurificationChamber.java +++ b/src/main/java/mekanism/client/gui/GuiPurificationChamber.java @@ -1,5 +1,6 @@ package mekanism.client.gui; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.tile.TileEntityAdvancedElectricMachine; import net.minecraft.entity.player.InventoryPlayer; import cpw.mods.fml.relauncher.Side; @@ -12,4 +13,10 @@ public class GuiPurificationChamber extends GuiAdvancedElectricMachine { super(inventory, tentity); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.RED; + } } diff --git a/src/main/java/mekanism/client/nei/AdvancedMachineRecipeHandler.java b/src/main/java/mekanism/client/nei/AdvancedMachineRecipeHandler.java index c54eacac6..957a73c71 100644 --- a/src/main/java/mekanism/client/nei/AdvancedMachineRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/AdvancedMachineRecipeHandler.java @@ -13,8 +13,18 @@ import java.util.Set; import mekanism.api.AdvancedInput; import mekanism.api.gas.Gas; import mekanism.api.gas.GasStack; +import mekanism.client.gui.GuiElement; +import mekanism.client.gui.GuiPowerBar; +import mekanism.client.gui.GuiProgress; +import mekanism.client.gui.GuiPowerBar.IPowerInfoHandler; +import mekanism.client.gui.GuiProgress.IProgressInfoHandler; +import mekanism.client.gui.GuiProgress.ProgressBar; +import mekanism.client.gui.GuiSlot; +import mekanism.client.gui.GuiSlot.SlotOverlay; +import mekanism.client.gui.GuiSlot.SlotType; import mekanism.common.ObfuscatedNames; import mekanism.common.util.MekanismUtils; +import mekanism.common.util.MekanismUtils.ResourceType; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; @@ -37,10 +47,31 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler public abstract List getFuelStacks(Gas gasType); + public abstract ProgressBar getProgressType(); + @Override public void addGuiElements() { - + guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 16)); + guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 30, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 52)); + guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 111, 30)); + + guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() { + @Override + public double getLevel() + { + return ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; + } + }, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 164, 15)); + guiElements.add(new GuiProgress(new IProgressInfoHandler() + { + @Override + public double getProgress() + { + return ticksPassed >= 40 ? (ticksPassed - 40) % 20 / 20.0F : 0.0F; + } + }, getProgressType(), this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 77, 37)); } @Override @@ -49,6 +80,11 @@ public abstract class AdvancedMachineRecipeHandler 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); + } } @Override @@ -56,12 +92,9 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler { CachedIORecipe recipe = (CachedIORecipe)arecipes.get(i); - float f = ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0; - drawProgressBar(63, 34, 176, 0, 24, 7, f, 0); - - if(recipe.input.gasType != null) + if(recipe.input.gasType != null && ticksPassed >= 20) { - int displayInt = ticksPassed < 20 ? ticksPassed*12 / 20 : 12; + int displayInt = ticksPassed < 40 ? (ticksPassed-20)*12 / 20 : 12; displayGauge(45, 32 + 12 - displayInt, 6, displayInt, new GasStack(recipe.input.gasType, 1)); } } diff --git a/src/main/java/mekanism/client/nei/ChanceMachineRecipeHandler.java b/src/main/java/mekanism/client/nei/ChanceMachineRecipeHandler.java index 5edece75a..891633438 100644 --- a/src/main/java/mekanism/client/nei/ChanceMachineRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/ChanceMachineRecipeHandler.java @@ -10,6 +10,17 @@ import java.util.Map.Entry; import java.util.Set; import mekanism.api.ChanceOutput; +import mekanism.client.gui.GuiElement; +import mekanism.client.gui.GuiPowerBar; +import mekanism.client.gui.GuiPowerBar.IPowerInfoHandler; +import mekanism.client.gui.GuiProgress; +import mekanism.client.gui.GuiProgress.IProgressInfoHandler; +import mekanism.client.gui.GuiProgress.ProgressBar; +import mekanism.client.gui.GuiSlot; +import mekanism.client.gui.GuiSlot.SlotOverlay; +import mekanism.client.gui.GuiSlot.SlotType; +import mekanism.common.util.MekanismUtils; +import mekanism.common.util.MekanismUtils.ResourceType; import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; @@ -26,10 +37,30 @@ public abstract class ChanceMachineRecipeHandler extends BaseRecipeHandler public abstract Set> getRecipes(); + public abstract ProgressBar getProgressType(); + @Override public void addGuiElements() { + guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 16)); + guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 52).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 111, 30)); + guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() { + @Override + public double getLevel() + { + return ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; + } + }, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 164, 15)); + guiElements.add(new GuiProgress(new IProgressInfoHandler() + { + @Override + public double getProgress() + { + return ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0.0F; + } + }, getProgressType(), this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 77, 37)); } @Override @@ -38,6 +69,11 @@ public abstract class ChanceMachineRecipeHandler 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); + } } @Override @@ -45,11 +81,6 @@ public abstract class ChanceMachineRecipeHandler extends BaseRecipeHandler { CachedIORecipe recipe = (CachedIORecipe)arecipes.get(i); - float f = ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0.0F; - drawProgressBar(63, 34, 176, 0, 24, 7, f, 0); - f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; - drawProgressBar(149, 12, 176, 7, 4, 52, f, 3); - if(recipe.output.hasSecondary()) { drawString(Math.round(recipe.output.secondaryChance*100) + "%", 116, 52, 0x404040, false); @@ -103,7 +134,7 @@ public abstract class ChanceMachineRecipeHandler extends BaseRecipeHandler @Override public String getGuiTexture() { - return "mekanism:gui/GuiAdvancedMachine.png"; + return "mekanism:gui/GuiBasicMachine.png"; } @Override diff --git a/src/main/java/mekanism/client/nei/ChemicalInjectionChamberRecipeHandler.java b/src/main/java/mekanism/client/nei/ChemicalInjectionChamberRecipeHandler.java index 1b2589500..64279f95e 100644 --- a/src/main/java/mekanism/client/nei/ChemicalInjectionChamberRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/ChemicalInjectionChamberRecipeHandler.java @@ -8,6 +8,7 @@ import mekanism.api.ListUtils; import mekanism.api.gas.Gas; import mekanism.api.gas.GasRegistry; import mekanism.client.gui.GuiChemicalInjectionChamber; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; import net.minecraft.item.ItemStack; @@ -67,6 +68,12 @@ public class ChemicalInjectionChamberRecipeHandler extends AdvancedMachineRecipe return new ArrayList(); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.YELLOW; + } @Override public Class getGuiClass() diff --git a/src/main/java/mekanism/client/nei/CombinerRecipeHandler.java b/src/main/java/mekanism/client/nei/CombinerRecipeHandler.java index 06178d47a..6fd7933aa 100644 --- a/src/main/java/mekanism/client/nei/CombinerRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/CombinerRecipeHandler.java @@ -6,6 +6,7 @@ import java.util.Set; import mekanism.api.ListUtils; import mekanism.api.gas.Gas; import mekanism.client.gui.GuiCombiner; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; import net.minecraft.init.Blocks; @@ -42,6 +43,12 @@ public class CombinerRecipeHandler extends AdvancedMachineRecipeHandler { return "mekanism:gui/GuiCombiner.png"; } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.STONE; + } @Override public List getFuelStacks(Gas gasType) diff --git a/src/main/java/mekanism/client/nei/CrusherRecipeHandler.java b/src/main/java/mekanism/client/nei/CrusherRecipeHandler.java index cbb20f30b..8032df384 100644 --- a/src/main/java/mekanism/client/nei/CrusherRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/CrusherRecipeHandler.java @@ -4,6 +4,7 @@ import java.util.Set; import mekanism.client.gui.GuiCrusher; import mekanism.client.gui.GuiSlot; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.client.gui.GuiSlot.SlotType; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; @@ -28,6 +29,12 @@ public class CrusherRecipeHandler extends MachineRecipeHandler { return "crusher"; } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.CRUSH; + } @Override public Set getRecipes() diff --git a/src/main/java/mekanism/client/nei/EnrichmentChamberRecipeHandler.java b/src/main/java/mekanism/client/nei/EnrichmentChamberRecipeHandler.java index da23745a4..3bc0989d7 100644 --- a/src/main/java/mekanism/client/nei/EnrichmentChamberRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/EnrichmentChamberRecipeHandler.java @@ -3,6 +3,7 @@ package mekanism.client.nei; import java.util.Set; import mekanism.client.gui.GuiEnrichmentChamber; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; @@ -25,6 +26,12 @@ public class EnrichmentChamberRecipeHandler extends MachineRecipeHandler { return "chamber"; } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.BLUE; + } @Override public Set getRecipes() diff --git a/src/main/java/mekanism/client/nei/MachineRecipeHandler.java b/src/main/java/mekanism/client/nei/MachineRecipeHandler.java index bac50e02b..b44731316 100644 --- a/src/main/java/mekanism/client/nei/MachineRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/MachineRecipeHandler.java @@ -10,7 +10,9 @@ import java.util.Map.Entry; import java.util.Set; import mekanism.client.gui.GuiElement; +import mekanism.client.gui.GuiPowerBar; import mekanism.client.gui.GuiProgress; +import mekanism.client.gui.GuiPowerBar.IPowerInfoHandler; import mekanism.client.gui.GuiProgress.IProgressInfoHandler; import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.client.gui.GuiSlot; @@ -18,7 +20,6 @@ import mekanism.client.gui.GuiSlot.SlotOverlay; import mekanism.client.gui.GuiSlot.SlotType; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; - import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; @@ -35,6 +36,8 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler public abstract Set> getRecipes(); + public abstract ProgressBar getProgressType(); + @Override public void addGuiElements() { @@ -42,6 +45,13 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 52).with(SlotOverlay.POWER)); guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 111, 30)); + guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() { + @Override + public double getLevel() + { + return ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; + } + }, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 164, 15)); guiElements.add(new GuiProgress(new IProgressInfoHandler() { @Override @@ -49,7 +59,7 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler { return ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0.0F; } - }, ProgressBar.BLUE, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 77, 37)); + }, getProgressType(), this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 77, 37)); } @Override @@ -65,15 +75,6 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler } } - @Override - public void drawExtras(int i) - { - float f = ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0.0F; - drawProgressBar(63, 34, 176, 0, 24, 7, f, 0); - f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; - drawProgressBar(149, 12, 176, 7, 4, 52, f, 3); - } - @Override public void onUpdate() { diff --git a/src/main/java/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java b/src/main/java/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java index cb3fe2edd..d8f91910e 100644 --- a/src/main/java/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java @@ -15,9 +15,19 @@ import mekanism.api.infuse.InfuseRegistry; import mekanism.api.infuse.InfuseType; import mekanism.api.infuse.InfusionInput; import mekanism.api.infuse.InfusionOutput; +import mekanism.client.gui.GuiElement; import mekanism.client.gui.GuiMetallurgicInfuser; +import mekanism.client.gui.GuiPowerBar; +import mekanism.client.gui.GuiPowerBar.IPowerInfoHandler; +import mekanism.client.gui.GuiProgress; +import mekanism.client.gui.GuiSlot; +import mekanism.client.gui.GuiProgress.IProgressInfoHandler; +import mekanism.client.gui.GuiProgress.ProgressBar; +import mekanism.client.gui.GuiSlot.SlotOverlay; +import mekanism.client.gui.GuiSlot.SlotType; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; +import mekanism.common.util.MekanismUtils.ResourceType; import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; @@ -29,6 +39,30 @@ import codechicken.nei.recipe.TemplateRecipeHandler; public class MetallurgicInfuserRecipeHandler extends BaseRecipeHandler { private int ticksPassed; + + @Override + public void addGuiElements() + { + guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 16, 34)); + guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 50, 42)); + guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 142, 34).with(SlotOverlay.POWER)); + guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 108, 42)); + + guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() { + @Override + public double getLevel() + { + return ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; + } + }, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 164, 15)); + guiElements.add(new GuiProgress(new IProgressInfoHandler() { + @Override + public double getProgress() + { + return ticksPassed >= 40 ? (ticksPassed - 40) % 20 / 20.0F : 0.0F; + } + }, ProgressBar.MEDIUM, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 70, 46)); + } @Override public String getRecipeName() @@ -85,6 +119,11 @@ public class MetallurgicInfuserRecipeHandler extends BaseRecipeHandler GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); changeTexture(getGuiTexture()); drawTexturedModalRect(0, 0, 5, 15, 166, 56); + + for(GuiElement e : guiElements) + { + e.renderBackground(0, 0, -5, -15); + } } @Override @@ -92,15 +131,9 @@ public class MetallurgicInfuserRecipeHandler extends BaseRecipeHandler { InfuseType type = ((CachedIORecipe)arecipes.get(i)).infusionType; - float f = ticksPassed >= 40 ? (ticksPassed - 40) % 20 / 20.0F : 0.0F; - drawProgressBar(67, 32, 176, 52, 32, 8, f, 0); - - f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F; + float f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F; if(ticksPassed < 20) f = 0.0F; - f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; - drawProgressBar(160, 2, 176, 0, 4, 52, f, 3); - changeTexture(type.texture); drawProgressBar(2, 2, type.texX, type.texY, 4, 52, f, 3); } @@ -164,12 +197,6 @@ public class MetallurgicInfuserRecipeHandler extends BaseRecipeHandler } } - @Override - public void addGuiElements() - { - - } - public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { public List infuseStacks; diff --git a/src/main/java/mekanism/client/nei/NEIMekanismConfig.java b/src/main/java/mekanism/client/nei/NEIMekanismConfig.java index 3cf14e86f..ca95d0843 100644 --- a/src/main/java/mekanism/client/nei/NEIMekanismConfig.java +++ b/src/main/java/mekanism/client/nei/NEIMekanismConfig.java @@ -107,6 +107,6 @@ public class NEIMekanismConfig implements IConfigureNEI @Override public String getVersion() { - return "1.2"; + return "1.3"; } } diff --git a/src/main/java/mekanism/client/nei/OsmiumCompressorRecipeHandler.java b/src/main/java/mekanism/client/nei/OsmiumCompressorRecipeHandler.java index 4a03f3e25..34f19a8cf 100644 --- a/src/main/java/mekanism/client/nei/OsmiumCompressorRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/OsmiumCompressorRecipeHandler.java @@ -6,6 +6,7 @@ import java.util.Set; import mekanism.api.ListUtils; import mekanism.api.gas.Gas; import mekanism.client.gui.GuiOsmiumCompressor; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.Mekanism; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; @@ -36,6 +37,12 @@ public class OsmiumCompressorRecipeHandler extends AdvancedMachineRecipeHandler { return Recipe.OSMIUM_COMPRESSOR.get().entrySet(); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.RED; + } @Override public List getFuelStacks(Gas gasType) diff --git a/src/main/java/mekanism/client/nei/PrecisionSawmillRecipeHandler.java b/src/main/java/mekanism/client/nei/PrecisionSawmillRecipeHandler.java index 5a0b4efbc..407b698db 100644 --- a/src/main/java/mekanism/client/nei/PrecisionSawmillRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/PrecisionSawmillRecipeHandler.java @@ -3,6 +3,7 @@ package mekanism.client.nei; import java.util.Set; import mekanism.client.gui.GuiPrecisionSawmill; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; @@ -31,6 +32,12 @@ public class PrecisionSawmillRecipeHandler extends ChanceMachineRecipeHandler { return Recipe.PRECISION_SAWMILL.get().entrySet(); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.PURPLE; + } @Override public Class getGuiClass() diff --git a/src/main/java/mekanism/client/nei/PurificationChamberRecipeHandler.java b/src/main/java/mekanism/client/nei/PurificationChamberRecipeHandler.java index 97ae06efa..e044fc44c 100644 --- a/src/main/java/mekanism/client/nei/PurificationChamberRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/PurificationChamberRecipeHandler.java @@ -7,6 +7,7 @@ import java.util.Set; import mekanism.api.ListUtils; import mekanism.api.gas.Gas; import mekanism.api.gas.GasRegistry; +import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.client.gui.GuiPurificationChamber; import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.util.MekanismUtils; @@ -38,6 +39,12 @@ public class PurificationChamberRecipeHandler extends AdvancedMachineRecipeHandl { return Recipe.PURIFICATION_CHAMBER.get().entrySet(); } + + @Override + public ProgressBar getProgressType() + { + return ProgressBar.RED; + } @Override public List getFuelStacks(Gas gasType) diff --git a/src/main/java/mekanism/common/recipe/RecipeHandler.java b/src/main/java/mekanism/common/recipe/RecipeHandler.java index 88d5014c0..9e2d1aa21 100644 --- a/src/main/java/mekanism/common/recipe/RecipeHandler.java +++ b/src/main/java/mekanism/common/recipe/RecipeHandler.java @@ -174,10 +174,11 @@ public final class RecipeHandler } /** - * Add a Pressurized Reaction Chamber recipe + * Add a Pressurized Reaction Chamber recipe. * @param input - input PressurizedReactants * @param output - output PressurizedProducts * @param extraEnergy - extra energy needed by the recipe + * @param ticks - amount of ticks it takes for this recipe to complete */ public static void addPRCRecipe(PressurizedReactants input, PressurizedProducts output, double extraEnergy, int ticks) { diff --git a/src/main/java/mekanism/common/tile/TileEntityBasicMachine.java b/src/main/java/mekanism/common/tile/TileEntityBasicMachine.java index fef69533f..01bf1ee4d 100644 --- a/src/main/java/mekanism/common/tile/TileEntityBasicMachine.java +++ b/src/main/java/mekanism/common/tile/TileEntityBasicMachine.java @@ -84,8 +84,6 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp isActive = false; } - public abstract ProgressBar getProgressType(); - @Override public void onUpdate() { diff --git a/src/main/java/mekanism/common/tile/TileEntityChemicalInjectionChamber.java b/src/main/java/mekanism/common/tile/TileEntityChemicalInjectionChamber.java index c4cef5894..aabd82050 100644 --- a/src/main/java/mekanism/common/tile/TileEntityChemicalInjectionChamber.java +++ b/src/main/java/mekanism/common/tile/TileEntityChemicalInjectionChamber.java @@ -88,10 +88,4 @@ public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectr { return gas == GasRegistry.getGas("sulfuricAcid") || gas == GasRegistry.getGas("water") || gas == GasRegistry.getGas("hydrogenChloride"); } - - @Override - public ProgressBar getProgressType() - { - return ProgressBar.YELLOW; - } } diff --git a/src/main/java/mekanism/common/tile/TileEntityCombiner.java b/src/main/java/mekanism/common/tile/TileEntityCombiner.java index 201f7226c..c16220ae0 100644 --- a/src/main/java/mekanism/common/tile/TileEntityCombiner.java +++ b/src/main/java/mekanism/common/tile/TileEntityCombiner.java @@ -43,10 +43,4 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine { return false; } - - @Override - public ProgressBar getProgressType() - { - return ProgressBar.STONE; - } } diff --git a/src/main/java/mekanism/common/tile/TileEntityCrusher.java b/src/main/java/mekanism/common/tile/TileEntityCrusher.java index 71fb44afa..45e03dd35 100644 --- a/src/main/java/mekanism/common/tile/TileEntityCrusher.java +++ b/src/main/java/mekanism/common/tile/TileEntityCrusher.java @@ -2,7 +2,6 @@ package mekanism.common.tile; import java.util.Map; -import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.Mekanism; import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.recipe.RecipeHandler.Recipe; @@ -57,10 +56,4 @@ public class TileEntityCrusher extends TileEntityElectricMachine { return 0.5F; } - - @Override - public ProgressBar getProgressType() - { - return ProgressBar.CRUSH; - } } diff --git a/src/main/java/mekanism/common/tile/TileEntityEnergizedSmelter.java b/src/main/java/mekanism/common/tile/TileEntityEnergizedSmelter.java index 6dbf5ef93..0a1d13fcd 100644 --- a/src/main/java/mekanism/common/tile/TileEntityEnergizedSmelter.java +++ b/src/main/java/mekanism/common/tile/TileEntityEnergizedSmelter.java @@ -22,10 +22,4 @@ public class TileEntityEnergizedSmelter extends TileEntityElectricMachine { return furnaceRecipes; } - - @Override - public ProgressBar getProgressType() - { - return ProgressBar.GREEN; - } } diff --git a/src/main/java/mekanism/common/tile/TileEntityEnrichmentChamber.java b/src/main/java/mekanism/common/tile/TileEntityEnrichmentChamber.java index 5e56d04ad..5bb8b3daa 100644 --- a/src/main/java/mekanism/common/tile/TileEntityEnrichmentChamber.java +++ b/src/main/java/mekanism/common/tile/TileEntityEnrichmentChamber.java @@ -25,10 +25,4 @@ public class TileEntityEnrichmentChamber extends TileEntityElectricMachine { return 0.3F; } - - @Override - public ProgressBar getProgressType() - { - return ProgressBar.BLUE; - } } diff --git a/src/main/java/mekanism/common/tile/TileEntityOsmiumCompressor.java b/src/main/java/mekanism/common/tile/TileEntityOsmiumCompressor.java index 6f1596a94..a7492c6a3 100644 --- a/src/main/java/mekanism/common/tile/TileEntityOsmiumCompressor.java +++ b/src/main/java/mekanism/common/tile/TileEntityOsmiumCompressor.java @@ -5,7 +5,6 @@ import java.util.Map; import mekanism.api.gas.Gas; import mekanism.api.gas.GasRegistry; import mekanism.api.gas.GasStack; -import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.Mekanism; import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.recipe.RecipeHandler.Recipe; @@ -54,10 +53,4 @@ public class TileEntityOsmiumCompressor extends TileEntityAdvancedElectricMachin { return false; } - - @Override - public ProgressBar getProgressType() - { - return ProgressBar.RED; - } } diff --git a/src/main/java/mekanism/common/tile/TileEntityPRC.java b/src/main/java/mekanism/common/tile/TileEntityPRC.java index 6feffe431..a2ccfd08f 100644 --- a/src/main/java/mekanism/common/tile/TileEntityPRC.java +++ b/src/main/java/mekanism/common/tile/TileEntityPRC.java @@ -15,7 +15,6 @@ import mekanism.api.gas.GasStack; import mekanism.api.gas.GasTank; import mekanism.api.gas.IGasHandler; import mekanism.api.gas.ITubeConnection; -import mekanism.client.gui.GuiProgress.ProgressBar; import mekanism.common.Mekanism; import mekanism.common.SideData; import mekanism.common.block.BlockMachine.MachineType; @@ -95,6 +94,7 @@ public class TileEntityPRC extends TileEntityBasicMachine implements IFluidHandl } else { TICKS_REQUIRED = 100; + if(prevEnergy >= getEnergy()) { setActive(false); @@ -125,12 +125,6 @@ public class TileEntityPRC extends TileEntityBasicMachine implements IFluidHandl } } - @Override - public ProgressBar getProgressType() - { - return ProgressBar.MEDIUM; - } - @Override public boolean isItemValidForSlot(int slotID, ItemStack itemstack) { diff --git a/src/main/java/mekanism/common/tile/TileEntityPrecisionSawmill.java b/src/main/java/mekanism/common/tile/TileEntityPrecisionSawmill.java index ba3a62eab..5146289ed 100644 --- a/src/main/java/mekanism/common/tile/TileEntityPrecisionSawmill.java +++ b/src/main/java/mekanism/common/tile/TileEntityPrecisionSawmill.java @@ -27,10 +27,4 @@ public class TileEntityPrecisionSawmill extends TileEntityChanceMachine { return 0.7F; } - - @Override - public ProgressBar getProgressType() - { - return ProgressBar.PURPLE; - } } diff --git a/src/main/java/mekanism/common/tile/TileEntityPurificationChamber.java b/src/main/java/mekanism/common/tile/TileEntityPurificationChamber.java index cec2bfeff..7d8764f0e 100644 --- a/src/main/java/mekanism/common/tile/TileEntityPurificationChamber.java +++ b/src/main/java/mekanism/common/tile/TileEntityPurificationChamber.java @@ -82,10 +82,4 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac { return gas == GasRegistry.getGas("oxygen"); } - - @Override - public ProgressBar getProgressType() - { - return ProgressBar.RED; - } } diff --git a/src/main/resources/assets/mekanism/lang/en_US.lang b/src/main/resources/assets/mekanism/lang/en_US.lang index 4b87a342c..cefb1e78a 100644 --- a/src/main/resources/assets/mekanism/lang/en_US.lang +++ b/src/main/resources/assets/mekanism/lang/en_US.lang @@ -413,7 +413,7 @@ gui.digitalMiner.running=Running gui.digitalMiner.inverse=Inverse mode //Recipe names -recipe.mekanismShaped=Shaped Crafting +recipe.mekanismShaped=Shaped //Item and block tooltip text tooltip.configurator.modify=Modify