本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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)};
}
示例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)};
}
示例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) };
}
示例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();
}
示例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)
};
}
示例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);
}
示例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);
}
示例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()) };
}
示例12: getTankProperties
import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties() {
return FluidTankProperties.convert(new FluidTankInfo[]{a.getInfo(), b.getInfo()});
}
示例13: getTankProperties
import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties()
{
return new FluidTankProperties[] { new FluidTankProperties(getFluid(), capacity) };
}
示例14: getTankProperties
import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties()
{
return new IFluidTankProperties[] { new FluidTankProperties(getFluid(), capacity) };
}
示例15: getTankProperties
import net.minecraftforge.fluids.capability.FluidTankProperties; //导入依赖的package包/类
@Override
public IFluidTankProperties[] getTankProperties()
{
return new FluidTankProperties[] { new FluidTankProperties(getFluid(), Fluid.BUCKET_VOLUME) };
}