当前位置: 首页>>代码示例>>Java>>正文


Java FluidTankProperties类代码示例

本文整理汇总了Java中net.minecraftforge.fluids.capability.FluidTankProperties的典型用法代码示例。如果您正苦于以下问题:Java FluidTankProperties类的具体用法?Java FluidTankProperties怎么用?Java FluidTankProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FluidTankProperties类属于net.minecraftforge.fluids.capability包,在下文中一共展示了FluidTankProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@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;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:18,代码来源:MultiFluidTank.java

示例2: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@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;
}
 
开发者ID:Lumaceon,项目名称:ClockworkPhase2,代码行数:19,代码来源:FluidHandlerItemStackMultitank.java

示例3: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@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;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:16,代码来源:TileEntityAerialInterface.java

示例4: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@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)};
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:FluidBlockWrapper.java

示例5: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@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)};
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:BlockLiquidWrapper.java

示例6: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties()
{
    FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(container);
    int capacity = FluidContainerRegistry.getContainerCapacity(fluid, container);
    return new FluidTankProperties[] { new FluidTankProperties(fluid, capacity) };
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:FluidContainerRegistryWrapper.java

示例7: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties() {

    if (world.isRemote) {
        return new IFluidTankProperties[] { new FluidTankProperties(liquid_state.s_liquid, EnderLiquidStorage.CAPACITY) };
    }
    return getStorage().getTankProperties();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:9,代码来源:TileEnderTank.java

示例8: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties() {
    return new IFluidTankProperties[] {
        new FluidTankProperties(new FluidStack(FluidsRegistry.liquidXP, LiquidXPCollectorItem.getStoredXP(this.stack)),
                LiquidXPCollectorItem.MAX_CAPACITY, true, true)
    };
}
 
开发者ID:faceofcat,项目名称:Mekfarm,代码行数:8,代码来源:LiquidXPCollectorItem.java

示例9: getCapability

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@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);
}
 
开发者ID:TheCBProject,项目名称:Translocators,代码行数:29,代码来源:TileLiquidTranslocator.java

示例10: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties() {
  if(network == null) {
    return new FluidTankProperties[0];
  }
  return network.getTankProperties(EnderLiquidConduit.this, side);
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:8,代码来源:EnderLiquidConduit.java

示例11: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties() {
  if (network == null) {
    return new FluidTankProperties[0];
  }
  return new FluidTankProperties[] { new FluidTankProperties(tank.getFluid(), tank.getCapacity()) };
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:8,代码来源:AdvancedLiquidConduit.java

示例12: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties() {
	return FluidTankProperties.convert(new FluidTankInfo[]{a.getInfo(), b.getInfo()});
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:5,代码来源:ValidatedDoubleTank.java

示例13: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties()
{
    return new FluidTankProperties[] { new FluidTankProperties(getFluid(), capacity) };
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:FluidHandlerItemStack.java

示例14: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties()
{
    return new IFluidTankProperties[] { new FluidTankProperties(getFluid(), capacity) };
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:FluidHandlerItemStackSimple.java

示例15: getTankProperties

import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties()
{
    return new FluidTankProperties[] { new FluidTankProperties(getFluid(), Fluid.BUCKET_VOLUME) };
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:FluidBucketWrapper.java


注:本文中的net.minecraftforge.fluids.capability.FluidTankProperties类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。