diff --git a/resources/assets/enderio/config/VatRecipes_Core.xml b/resources/assets/enderio/config/VatRecipes_Core.xml index 31fe07bf..9b86b8dc 100644 --- a/resources/assets/enderio/config/VatRecipes_Core.xml +++ b/resources/assets/enderio/config/VatRecipes_Core.xml @@ -20,20 +20,21 @@ - + + - + diff --git a/resources/assets/enderio/lang/en_US.lang b/resources/assets/enderio/lang/en_US.lang index 6fbd2a52..9d99fddf 100644 --- a/resources/assets/enderio/lang/en_US.lang +++ b/resources/assets/enderio/lang/en_US.lang @@ -41,9 +41,11 @@ enderio.conduitBinder.name=Conduit Binder enderio.binderComposite.name=Binder Composite enderio.phasedIronNugget.name=Pulsating Iron Nugget -//Liquids +//Fluids item.bucketNutrientdistillation.name=Nutrient Distillation Bucket item.bucketHootch.name=Hootch Bucket +enderio.fluid.millibucket.abr=MB + //Crafting components enderio.itemMachinePart.name=Machine Parts @@ -206,6 +208,10 @@ enderio.gui.alloy.mode.all=All Smelting enderio.gui.alloy.mode.alloy=Alloys Only enderio.gui.alloy.mode.furnace=Furnace Only +//Vat +enderio.vat.outputTank=Output Tank +enderio.vat.inputTank=Input Tank + //Travel Blocks enderio.gui.travelAccessable.privateBlock1=Only enderio.gui.travelAccessable.privateBlock2=may change this blocks settings. diff --git a/resources/assets/enderio/textures/blocks/hootch_flow.png b/resources/assets/enderio/textures/blocks/hootch_flow.png index 7053d034..834bc1f8 100644 Binary files a/resources/assets/enderio/textures/blocks/hootch_flow.png and b/resources/assets/enderio/textures/blocks/hootch_flow.png differ diff --git a/resources/assets/enderio/textures/blocks/hootch_still.png b/resources/assets/enderio/textures/blocks/hootch_still.png index 5071c64e..81184284 100644 Binary files a/resources/assets/enderio/textures/blocks/hootch_still.png and b/resources/assets/enderio/textures/blocks/hootch_still.png differ diff --git a/resources/assets/enderio/textures/blocks/nutrientdistillation_flow.png b/resources/assets/enderio/textures/blocks/nutrient_distillation_flow.png similarity index 100% rename from resources/assets/enderio/textures/blocks/nutrientdistillation_flow.png rename to resources/assets/enderio/textures/blocks/nutrient_distillation_flow.png diff --git a/resources/assets/enderio/textures/blocks/nutrientdistillation_flow.png.mcmeta b/resources/assets/enderio/textures/blocks/nutrient_distillation_flow.png.mcmeta similarity index 100% rename from resources/assets/enderio/textures/blocks/nutrientdistillation_flow.png.mcmeta rename to resources/assets/enderio/textures/blocks/nutrient_distillation_flow.png.mcmeta diff --git a/resources/assets/enderio/textures/blocks/nutrientdistillation_still.png b/resources/assets/enderio/textures/blocks/nutrient_distillation_still.png similarity index 100% rename from resources/assets/enderio/textures/blocks/nutrientdistillation_still.png rename to resources/assets/enderio/textures/blocks/nutrient_distillation_still.png diff --git a/resources/assets/enderio/textures/blocks/nutrientdistillation_still.png.mcmeta b/resources/assets/enderio/textures/blocks/nutrient_distillation_still.png.mcmeta similarity index 100% rename from resources/assets/enderio/textures/blocks/nutrientdistillation_still.png.mcmeta rename to resources/assets/enderio/textures/blocks/nutrient_distillation_still.png.mcmeta diff --git a/resources/assets/enderio/textures/blocks/stillFront.png b/resources/assets/enderio/textures/blocks/stillFront.png index dc588e13..662cb545 100644 Binary files a/resources/assets/enderio/textures/blocks/stillFront.png and b/resources/assets/enderio/textures/blocks/stillFront.png differ diff --git a/resources/assets/enderio/textures/blocks/stillFrontOn.png b/resources/assets/enderio/textures/blocks/stillFrontOn.png index 2e30c049..2fe648af 100644 Binary files a/resources/assets/enderio/textures/blocks/stillFrontOn.png and b/resources/assets/enderio/textures/blocks/stillFrontOn.png differ diff --git a/resources/assets/enderio/textures/blocks/stillFrontOn.png.mcmeta b/resources/assets/enderio/textures/blocks/stillFrontOn.png.mcmeta new file mode 100644 index 00000000..ffc0e720 --- /dev/null +++ b/resources/assets/enderio/textures/blocks/stillFrontOn.png.mcmeta @@ -0,0 +1 @@ +{ "animation": { "frametime": 20, "frames": [ 0, 1, 2, 3, ] } } \ No newline at end of file diff --git a/resources/assets/enderio/textures/gui/still.png b/resources/assets/enderio/textures/gui/vat.png similarity index 100% rename from resources/assets/enderio/textures/gui/still.png rename to resources/assets/enderio/textures/gui/vat.png diff --git a/src/main/java/crazypants/enderio/fluid/Fluids.java b/src/main/java/crazypants/enderio/fluid/Fluids.java index f9bf1e11..ad2592db 100644 --- a/src/main/java/crazypants/enderio/fluid/Fluids.java +++ b/src/main/java/crazypants/enderio/fluid/Fluids.java @@ -1,10 +1,24 @@ package crazypants.enderio.fluid; +import crazypants.util.Lang; +import net.minecraftforge.fluids.IFluidTank; + public class Fluids { - public static final String NUTRIENT_DISTILLATION_NAME = "nutrientdistillation"; + public static final String NUTRIENT_DISTILLATION_NAME = "nutrient_distillation"; public static final String HOOTCH_NAME = "hootch"; + public static String toCapactityString(IFluidTank tank) { + if(tank == null) { + return "0/0 " + MB(); + } + return tank.getFluidAmount() + "/" + tank.getCapacity() + " " + MB(); + } + + public static String MB() { + return Lang.localize("fluid.millibucket.abr"); + } + } diff --git a/src/main/java/crazypants/enderio/machine/still/BlockVat.java b/src/main/java/crazypants/enderio/machine/still/BlockVat.java index 0f39b28e..299470a1 100644 --- a/src/main/java/crazypants/enderio/machine/still/BlockVat.java +++ b/src/main/java/crazypants/enderio/machine/still/BlockVat.java @@ -42,7 +42,7 @@ public class BlockVat extends AbstractMachineBlock { return super.onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9); } - //check for filled fluid containers and see if we can fill up + //check for filled fluid containers and see if we can empty them into our input tank FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(item); if(fluid == null) { if(item.getItem() == Items.water_bucket) { @@ -56,11 +56,11 @@ public class BlockVat extends AbstractMachineBlock { int filled = vat.fill(ForgeDirection.UP, fluid, false); if(filled >= fluid.amount) { vat.fill(ForgeDirection.UP, fluid, true); + if(!entityPlayer.capabilities.isCreativeMode) { + entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, Util.consumeItem(item)); + } + return true; } - if(!entityPlayer.capabilities.isCreativeMode) { - entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, Util.consumeItem(item)); - } - return true; } //now check for empty fluid containers to fill @@ -72,7 +72,7 @@ public class BlockVat extends AbstractMachineBlock { if(filled == null) { //this shouldn't be necessary but it appears to be a bug as the above method doesnt work FluidContainerData[] datas = FluidContainerRegistry.getRegisteredFluidContainerData(); for (FluidContainerData data : datas) { - if(data.fluid.getFluid().getName().equals(available.getFluid().getName())) { + if(data.fluid.getFluid().getName().equals(available.getFluid().getName()) && data.emptyContainer.isItemEqual(item)) { res = data.filledContainer.copy(); filled = FluidContainerRegistry.getFluidForFilledItem(res); } diff --git a/src/main/java/crazypants/enderio/machine/still/GuiVat.java b/src/main/java/crazypants/enderio/machine/still/GuiVat.java index 1320d7c5..d5221844 100644 --- a/src/main/java/crazypants/enderio/machine/still/GuiVat.java +++ b/src/main/java/crazypants/enderio/machine/still/GuiVat.java @@ -1,5 +1,7 @@ package crazypants.enderio.machine.still; +import java.awt.Rectangle; + import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.IIcon; import net.minecraftforge.fluids.FluidStack; @@ -7,18 +9,55 @@ import net.minecraftforge.fluids.FluidTank; import org.lwjgl.opengl.GL11; +import crazypants.enderio.fluid.Fluids; import crazypants.enderio.machine.GuiMachineBase; import crazypants.enderio.machine.IMachineRecipe.ResultStack; +import crazypants.enderio.machine.power.PowerDisplayUtil; import crazypants.enderio.machine.MachineRecipeInput; +import crazypants.gui.GuiToolTip; import crazypants.render.RenderUtil; +import crazypants.util.Lang; public class GuiVat extends GuiMachineBase { - private final TileVat still; + private static final String GUI_TEXTURE = "enderio:textures/gui/vat.png"; + + private final TileVat vat; public GuiVat(InventoryPlayer inventory, TileVat te) { super(te, new ContainerVat(inventory, te)); - still = te; + vat = te; + + addToolTip(new GuiToolTip(new Rectangle(30, 12, 15, 47), "") { + + @Override + protected void updateText() { + text.clear(); + String heading = Lang.localize("vat.inputTank"); + if(vat.inputTank.getFluid() != null) { + heading += ": " + vat.inputTank.getFluid().getFluid().getLocalizedName(); + } + text.add(heading); + text.add(Fluids.toCapactityString(vat.inputTank)); + } + + }); + + addToolTip(new GuiToolTip(new Rectangle(132,12,15,47), "") { + + @Override + protected void updateText() { + text.clear(); + String heading = Lang.localize("vat.outputTank"); + if(vat.outputTank.getFluid() != null) { + heading += ": " + vat.outputTank.getFluid().getFluid().getLocalizedName(); + } + text.add(heading); + text.add(Fluids.toCapactityString(vat.outputTank)); + } + + }); + } /** @@ -28,41 +67,41 @@ public class GuiVat extends GuiMachineBase { @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderUtil.bindTexture("enderio:textures/gui/still.png"); + RenderUtil.bindTexture(GUI_TEXTURE); int guiLeft = (width - xSize) / 2; int guiTop = (height - ySize) / 2; drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - if(still.getProgress() < 1 && still.getProgress() > 0) { - int scaled = still.getProgressScaled(12); + if(vat.getProgress() < 1 && vat.getProgress() > 0) { + int scaled = vat.getProgressScaled(12); drawTexturedModalRect(guiLeft + 81, guiTop + 76 - scaled, 176, 12 - scaled, 14, scaled + 2); IIcon inputIcon = null; - for (MachineRecipeInput input : still.getCurrentTask().getInputs()) { + for (MachineRecipeInput input : vat.getCurrentTask().getInputs()) { if(input.fluid != null && input.fluid.getFluid() != null) { inputIcon = input.fluid.getFluid().getStillIcon(); break; } } - VatMachineRecipe rec = (VatMachineRecipe) still.getCurrentTask().getRecipe(); + VatMachineRecipe rec = (VatMachineRecipe) vat.getCurrentTask().getRecipe(); IIcon outputIcon = null; - for (ResultStack res : rec.getCompletedResult(1.0f, still.getCurrentTask().getInputs())) { + for (ResultStack res : rec.getCompletedResult(1.0f, vat.getCurrentTask().getInputs())) { if(res.fluid != null && res.fluid.getFluid() != null) { outputIcon = res.fluid.getFluid().getStillIcon(); } } if(inputIcon != null && outputIcon != null) { - renderVat(inputIcon, outputIcon, still.getProgress()); + renderVat(inputIcon, outputIcon, vat.getProgress()); } } RenderUtil.bindBlockTexture(); - renderTank(still.inputTank, 30); - renderTank(still.outputTank, 132); + renderTank(vat.inputTank, 30); + renderTank(vat.outputTank, 132); - RenderUtil.bindTexture("enderio:textures/gui/still.png"); + RenderUtil.bindTexture(GUI_TEXTURE); super.drawGuiContainerBackgroundLayer(par1, par2, par3); } @@ -82,7 +121,7 @@ public class GuiVat extends GuiMachineBase { GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1, 1, 1, 1); - RenderUtil.bindTexture("enderio:textures/gui/still.png"); + RenderUtil.bindTexture(GUI_TEXTURE); drawTexturedModalRect(x, y, 0, 256 - 28, 26, 28); }