diff --git a/src/main/java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java b/src/main/java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java index 5bc96051..4cda80f8 100644 --- a/src/main/java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java +++ b/src/main/java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java @@ -14,6 +14,7 @@ import binnie.craftgui.resource.Texture; import binnie.craftgui.resource.minecraft.StandardTexture; import binnie.extratrees.core.ExtraTreeTexture; import binnie.extratrees.machines.distillery.DistilleryLogic; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; @@ -44,6 +45,7 @@ public class ControlDistilleryProgress extends ControlProgressBase { DistilleryLogic distilleryLogic = Machine.getInterface(DistilleryLogic.class, Window.get(this).getInventory()); if (distilleryLogic != null) { final int level = distilleryLogic.level; + GlStateManager.enableAlpha(); CraftGUI.render.texture(OUTPUT, new IPoint(47, 14 + level * 15)); CraftGUI.render.texture(DISTILLERY_OVERLAY, IPoint.ZERO); } diff --git a/src/main/java/binnie/extratrees/machines/distillery/DistilleryLogic.java b/src/main/java/binnie/extratrees/machines/distillery/DistilleryLogic.java index aaac2398..615ed058 100644 --- a/src/main/java/binnie/extratrees/machines/distillery/DistilleryLogic.java +++ b/src/main/java/binnie/extratrees/machines/distillery/DistilleryLogic.java @@ -7,14 +7,17 @@ import binnie.core.machines.power.ErrorState; import binnie.core.machines.power.IProcess; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.relauncher.Side; +import javax.annotation.Nullable; import java.util.Map; public class DistilleryLogic extends ComponentProcessSetCost implements IProcess, INetwork.SendGuiNBT, INetwork.RecieveGuiNBT { - public static final int INPUT_FLUID_AMOUNT = 1000; + public static final int INPUT_FLUID_AMOUNT = Fluid.BUCKET_VOLUME; + @Nullable public FluidStack currentFluid; public int level; @@ -38,12 +41,22 @@ public class DistilleryLogic extends ComponentProcessSetCost implements IProcess public void readFromNBT(final NBTTagCompound nbt) { super.readFromNBT(nbt); this.level = nbt.getByte("dlevel"); + + NBTTagCompound fluidNbt = nbt.getCompoundTag("fluid"); + this.currentFluid = FluidStack.loadFluidStackFromNBT(fluidNbt); } @Override public NBTTagCompound writeToNBT(final NBTTagCompound nbt2) { NBTTagCompound nbt = super.writeToNBT(nbt2); nbt.setByte("dlevel", (byte) this.level); + + NBTTagCompound fluidNbt = new NBTTagCompound(); + if (this.currentFluid != null) { + this.currentFluid.writeToNBT(fluidNbt); + } + nbt.setTag("fluid", fluidNbt); + return nbt; } @@ -77,6 +90,7 @@ public class DistilleryLogic extends ComponentProcessSetCost implements IProcess protected void onFinishTask() { final FluidStack output = DistilleryRecipes.getOutput(this.currentFluid, this.level); this.getUtil().fillTank(DistilleryMachine.TANK_OUTPUT, output); + this.currentFluid = null; } @Override