Update deps + add nullcheck in fluidstorage

This commit is contained in:
Raoul Van den Berge
2016-08-16 21:54:19 +02:00
parent 86f110162d
commit 226b5d3784
4 changed files with 12 additions and 9 deletions

View File

@@ -50,7 +50,11 @@ public abstract class FluidStorageNBT implements IFluidStorage {
NBTTagList list = (NBTTagList) tag.getTag(NBT_FLUIDS);
for (int i = 0; i < list.tagCount(); ++i) {
stacks.add(FluidStack.loadFluidStackFromNBT(list.getCompoundTagAt(i)));
FluidStack stack = FluidStack.loadFluidStackFromNBT(list.getCompoundTagAt(i));
if (stack != null) {
stacks.add(stack);
}
}
}

View File

@@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack;
import refinedstorage.container.slot.SlotSpecimen;
import refinedstorage.tile.TileStorage;
//bla
public class ContainerStorage extends ContainerBase {
public ContainerStorage(TileStorage tile, EntityPlayer player) {
super(tile, player);

View File

@@ -94,7 +94,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
} else if (type == IType.FLUIDS) {
FluidStack stack = fluidFilters.getFluids()[0];
if (stack != null) {
if (stack != null && stack.getFluid().canBePlacedInWorld()) {
BlockPos front = pos.offset(getDirection());
Block block = stack.getFluid().getBlock();
@@ -103,10 +103,8 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
FluidStack took = network.extractFluid(stack, Fluid.BUCKET_VOLUME, compare);
if (took != null) {
IBlockState state = block.getDefaultState();
// @TODO: This doesn't cause the block to flow?
worldObj.setBlockState(front, state, 1 | 2);
// @TODO: Won't update
worldObj.setBlockState(front, block.getDefaultState(), 11);
}
}
}