mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 06:42:56 +00:00
Fixed NBT reference losses
This commit is contained in:
1 parent
e1a5bf13c7
commit
6340bb3cdc
9 files changed
+28
-14
No files matched your search
@@ -22,6 +22,7 @@ import mekanism.common.util.FluidContainerUtils.ContainerEditMode;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.PipeUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -183,13 +184,13 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
|
||||
|
||||
if(ret != null)
|
||||
{
|
||||
fluidTank.setFluid(new FluidStack(ret.getFluid(), Math.min(fluidTank.getCapacity(), ret.amount)));
|
||||
fluidTank.setFluid(PipeUtils.copy(ret, Math.min(fluidTank.getCapacity(), ret.amount)));
|
||||
|
||||
int rejects = Math.max(0, ret.amount - fluidTank.getCapacity());
|
||||
|
||||
if(rejects > 0)
|
||||
{
|
||||
pushUp(new FluidStack(ret.getFluid(), rejects), true);
|
||||
pushUp(PipeUtils.copy(ret, rejects), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,13 +205,13 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
|
||||
|
||||
if(ret != null)
|
||||
{
|
||||
fluidTank.setFluid(new FluidStack(ret.getFluid(), Math.min(fluidTank.getCapacity(), ret.amount)));
|
||||
fluidTank.setFluid(PipeUtils.copy(ret, Math.min(fluidTank.getCapacity(), ret.amount)));
|
||||
|
||||
int rejects = Math.max(0, ret.amount - fluidTank.getCapacity());
|
||||
|
||||
if(rejects > 0)
|
||||
{
|
||||
pushUp(new FluidStack(ret.getFluid(), rejects), true);
|
||||
pushUp(PipeUtils.copy(ret, rejects), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -464,7 +465,7 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
|
||||
|
||||
if(filled < resource.amount && !isActive)
|
||||
{
|
||||
filled += pushUp(new FluidStack(resource.getFluid(), resource.amount-filled), doFill);
|
||||
filled += pushUp(PipeUtils.copy(resource, resource.amount-filled), doFill);
|
||||
}
|
||||
|
||||
if(filled > 0 && from == ForgeDirection.UP)
|
||||
|
||||
Reference in new issue
Block a user