Java 类net.minecraftforge.fluids.capability.FluidTankProperties 实例源码

项目:Qbar    文件:MultiFluidTank.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    if (this.fluids.isEmpty())
        return new IFluidTankProperties[0];
    IFluidTankProperties[] properties = new IFluidTankProperties[fluids.size()];
    for (int i = 0; i < fluids.size(); i++)
    {
        boolean first = i == 0;
        int capacity2 = fluids.get(i).amount;
        if (first)
            capacity2 += getCapacity() - getFluidAmount();
        properties[i] = new FluidTankProperties(fluids.get(i), capacity2, first, first);
    }

    return properties;
}
项目:ClockworkPhase2    文件:FluidHandlerItemStackMultitank.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    IFluidTankProperties[] ret = new IFluidTankProperties[tanks.size()];
    for(int i = 0; i < ret.length; i++)
    {
        IFluidTankProperties[] temp = tanks.get(i).getTankProperties();
        if(temp == null || temp.length < 1)
        {
            ret[i] = new FluidTankProperties(null, 0);
        }
        else
        {
            ret[i] = temp[0];
        }
    }
    return ret;
}
项目:pnc-repressurized    文件:TileEntityAerialInterface.java   
@Override
public IFluidTankProperties[] getTankProperties() {
    updateXpFluid();
    if (curXpFluid != null) {
        EntityPlayer player = getPlayer();
        if (player != null) {
            return new FluidTankProperties[] {
                new FluidTankProperties(
                        new FluidStack(curXpFluid, getPlayerXP(player) * PneumaticCraftAPIHandler.getInstance().liquidXPs.get(curXpFluid)),
                        Integer.MAX_VALUE)
            };
        }
    }
    return null;
}
项目:CustomWorldGen    文件:FluidBlockWrapper.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    float percentFilled = fluidBlock.getFilledPercentage(world, blockPos);
    if (percentFilled < 0)
    {
        percentFilled *= -1;
    }
    int amountFilled = Math.round(Fluid.BUCKET_VOLUME * percentFilled);
    FluidStack fluid = amountFilled > 0 ? new FluidStack(fluidBlock.getFluid(), amountFilled) : null;
    return new FluidTankProperties[]{ new FluidTankProperties(fluid, Fluid.BUCKET_VOLUME, false, true)};
}
项目:CustomWorldGen    文件:BlockLiquidWrapper.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    FluidStack containedStack = null;
    IBlockState blockState = world.getBlockState(blockPos);
    if (blockState.getBlock() == blockLiquid)
    {
        containedStack = getStack(blockState);
    }
    return new FluidTankProperties[]{new FluidTankProperties(containedStack, Fluid.BUCKET_VOLUME, false, true)};
}
项目:CustomWorldGen    文件:FluidContainerRegistryWrapper.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(container);
    int capacity = FluidContainerRegistry.getContainerCapacity(fluid, container);
    return new FluidTankProperties[] { new FluidTankProperties(fluid, capacity) };
}
项目:EnderStorage    文件:TileEnderTank.java   
@Override
public IFluidTankProperties[] getTankProperties() {

    if (world.isRemote) {
        return new IFluidTankProperties[] { new FluidTankProperties(liquid_state.s_liquid, EnderLiquidStorage.CAPACITY) };
    }
    return getStorage().getTankProperties();
}
项目:Mekfarm    文件:LiquidXPCollectorItem.java   
@Override
public IFluidTankProperties[] getTankProperties() {
    return new IFluidTankProperties[] {
        new FluidTankProperties(new FluidStack(FluidsRegistry.liquidXP, LiquidXPCollectorItem.getStoredXP(this.stack)),
                LiquidXPCollectorItem.MAX_CAPACITY, true, true)
    };
}
项目:Translocators    文件:TileLiquidTranslocator.java   
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
    if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
        if (facing == null) {
            final List<IFluidTankProperties> properties = new LinkedList<>();
            for (Attachment a : attachments) {
                if (a != null) {
                    properties.add(new FluidTankProperties(null, 0));
                }
            }
            return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(new DummyFluidCapability() {
                @Override
                public IFluidTankProperties[] getTankProperties() {
                    return properties.toArray(new IFluidTankProperties[0]);
                }
            });
        }
        if (attachments[facing.ordinal()] != null) {
            return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(new DummyFluidCapability() {
                @Override
                public IFluidTankProperties[] getTankProperties() {
                    return new IFluidTankProperties[] { new FluidTankProperties(null, 0) };
                }
            });
        }
    }
    return super.getCapability(capability, facing);
}
项目:EnderIO    文件:EnderLiquidConduit.java   
@Override
public IFluidTankProperties[] getTankProperties() {
  if(network == null) {
    return new FluidTankProperties[0];
  }
  return network.getTankProperties(EnderLiquidConduit.this, side);
}
项目:EnderIO    文件:AdvancedLiquidConduit.java   
@Override
public IFluidTankProperties[] getTankProperties() {
  if (network == null) {
    return new FluidTankProperties[0];
  }
  return new FluidTankProperties[] { new FluidTankProperties(tank.getFluid(), tank.getCapacity()) };
}
项目:EnderIO    文件:LiquidConduit.java   
@Override
public IFluidTankProperties[] getTankProperties() {
  if (network == null) {
    return new FluidTankProperties[0];
  }
  return new FluidTankProperties[] { new FluidTankProperties(tank.getFluid(), tank.getCapacity()) };
}
项目:Thermionics    文件:ValidatedDoubleTank.java   
@Override
public IFluidTankProperties[] getTankProperties() {
    return FluidTankProperties.convert(new FluidTankInfo[]{a.getInfo(), b.getInfo()});
}
项目:CustomWorldGen    文件:FluidHandlerItemStack.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    return new FluidTankProperties[] { new FluidTankProperties(getFluid(), capacity) };
}
项目:CustomWorldGen    文件:FluidHandlerItemStackSimple.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    return new IFluidTankProperties[] { new FluidTankProperties(getFluid(), capacity) };
}
项目:CustomWorldGen    文件:FluidBucketWrapper.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    return new FluidTankProperties[] { new FluidTankProperties(getFluid(), Fluid.BUCKET_VOLUME) };
}
项目:CustomWorldGen    文件:FluidHandlerWrapper.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    return FluidTankProperties.convert(handler.getTankInfo(side));
}
项目:CustomWorldGen    文件:FluidContainerItemWrapper.java   
@Override
public FluidTankProperties[] getTankProperties()
{
    return new FluidTankProperties[] { new FluidTankProperties(handler.getFluid(container), handler.getCapacity(container)) };
}
项目:Overlord    文件:MilkBottleWrapper.java   
@Override
public IFluidTankProperties[] getTankProperties() {
    return new FluidTankProperties[] { new FluidTankProperties(getFluid(), Fluid.BUCKET_VOLUME) };
}
项目:Overlord    文件:TileEntitySkeletonMaker.java   
@Override
public IFluidTankProperties[] getTankProperties() {
    return new IFluidTankProperties[]{new FluidTankProperties(new FluidStack(getFluid(), getFluidAmount()), getCapacity())};
}
项目:EnderStorage    文件:EnderLiquidStorage.java   
@Override
public IFluidTankProperties[] getTankProperties() {
    return new IFluidTankProperties[] { new FluidTankProperties(tank.getInfo().fluid, tank.getInfo().capacity) };
}
项目:Cyclic    文件:TileEntityBaseMachineFluid.java   
@Override
public IFluidTankProperties[] getTankProperties() {
  FluidTankInfo info = tank.getInfo();
  return new IFluidTankProperties[] { new FluidTankProperties(info.fluid, info.capacity, true, true) };
}
项目:Cyclic    文件:TileEntityXpPylon.java   
@Override
public IFluidTankProperties[] getTankProperties() {
  FluidTankInfo info = tank.getInfo();
  return new IFluidTankProperties[] { new FluidTankProperties(info.fluid, info.capacity, true, true) };
}
项目:Cyclic    文件:TileEntityHydrator.java   
@Override
public IFluidTankProperties[] getTankProperties() {
  FluidTankInfo info = tank.getInfo();
  return new IFluidTankProperties[] { new FluidTankProperties(info.fluid, info.capacity, true, true) };
}
项目:enderutilities    文件:FluidHandlerEnderBucket.java   
@Override
public IFluidTankProperties[] getTankProperties()
{
    return new FluidTankProperties[] { new FluidTankProperties(this.getFluid(), this.getCapacity()) };
}
项目:OpenBlocks    文件:ItemTankBlock.java   
@Override
public IFluidTankProperties[] getTankProperties() {
    final FluidTank tank = readTank(container);
    return new IFluidTankProperties[] { new FluidTankProperties(getFluid(tank), getCapacity(tank), true, true) };
}