Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4deab0c4ac
2 changed files with 30 additions and 8 deletions
|
@ -121,24 +121,23 @@ public class RecipeCrafter {
|
|||
for (int i = 0; i < recipe.getOutputsSize(); i++) {//This checks to see if it can fit all of the outputs
|
||||
if (!canFitStack(recipe.getOutput(i), outputSlots[i], recipe.useOreDic())) {
|
||||
canGiveInvAll = false;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (canGiveInvAll) {
|
||||
setCurrentRecipe(recipe);//Sets the current recipe then syncs
|
||||
this.currentNeededTicks = (int)(currentRecipe.tickTime() * (1.0 - speedMultiplier));
|
||||
this.currentTickTime = 0;
|
||||
this.currentTickTime = -1;
|
||||
syncIsActive();
|
||||
} else {
|
||||
this.currentTickTime = -1;
|
||||
syncIsActive();
|
||||
this.currentTickTime = -0;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!hasAllInputs()) {//If it doesn't have all the inputs reset
|
||||
currentRecipe = null;
|
||||
currentTickTime = -1;
|
||||
currentTickTime = 0;
|
||||
syncIsActive();
|
||||
}
|
||||
if (currentRecipe != null && currentTickTime >= currentNeededTicks) {//If it has reached the recipe tick time
|
||||
|
@ -274,7 +273,7 @@ public class RecipeCrafter {
|
|||
|
||||
|
||||
private boolean isActiveServer() {
|
||||
return currentRecipe != null && energy.getEnergyStored() >= currentRecipe.euPerTick();
|
||||
return currentRecipe != null && energy.getEnergyStored() >= currentRecipe.euPerTick() && currentTickTime != -1;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
|
|
|
@ -2,7 +2,9 @@ package techreborn.client.hud;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.colour.ColourARGB;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.util.Color;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
|
@ -14,6 +16,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -39,18 +42,38 @@ public class ChargeHud
|
|||
public void drawChargeHud(ScaledResolution res)
|
||||
{
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
ItemStack stack = player.getCurrentArmor(2);;
|
||||
ItemStack stack = player.getCurrentArmor(2);
|
||||
if(stack != null)
|
||||
{
|
||||
if((stack.getItem() instanceof IElectricItem) && ConfigTechReborn.ShowChargeHud)
|
||||
{
|
||||
double MaxCharge = ((IElectricItem) stack.getItem()).getMaxCharge(stack);
|
||||
double CurrentCharge = ElectricItem.manager.getCharge(stack);
|
||||
Color color = Color.GREEN;
|
||||
double quarter = MaxCharge / 4;
|
||||
double half = MaxCharge / 2;
|
||||
double threeQuarters = MaxCharge / 4 * 3;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(32826);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
mc.fontRenderer.drawString(Double.toString(CurrentCharge) + "/" + Double.toString(MaxCharge), 0, 0, 0);
|
||||
//Render the stack
|
||||
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, 0, 0);
|
||||
RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, stack, 0, 0);
|
||||
//Render Overlay
|
||||
if(CurrentCharge <= threeQuarters)
|
||||
{
|
||||
color = Color.YELLOW;
|
||||
}
|
||||
if(CurrentCharge <= half)
|
||||
{
|
||||
color = Color.RED;
|
||||
}
|
||||
if(CurrentCharge <= quarter)
|
||||
{
|
||||
color = Color.DARK_RED;
|
||||
}
|
||||
mc.fontRenderer.drawString(color + Double.toString(CurrentCharge) + "/" + Double.toString(MaxCharge), 20, 5, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue