本文整理汇总了Java中net.minecraftforge.fluids.BlockFluidFinite类的典型用法代码示例。如果您正苦于以下问题:Java BlockFluidFinite类的具体用法?Java BlockFluidFinite怎么用?Java BlockFluidFinite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockFluidFinite类属于net.minecraftforge.fluids包,在下文中一共展示了BlockFluidFinite类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setFluid
import net.minecraftforge.fluids.BlockFluidFinite; //导入依赖的package包/类
public EngineNiard setFluid(Fluid fluid) {
if (fluid.canBePlacedInWorld()) {
this.radiusItr = radius >= 0 ? new RadiusIterator(owner.getLocation(), radius) : null;
this.fluid = fluid;
this.downflowDirection = fluid.getDensity() > 0 ? ForgeDirection.DOWN : ForgeDirection.UP;
block = fluid.getBlock();
if (block instanceof BlockFluidClassic) {
type = FluidType.CLASSIC;
} else if (block instanceof BlockFluidFinite) {
type = FluidType.FINITE;
} else if (block instanceof BlockLiquid) {
type = FluidType.VANILLA;
} else {
this.fluid = null;
}
} else {
this.fluid = null;
}
return this;
}
示例2: setSourceBlock
import net.minecraftforge.fluids.BlockFluidFinite; //导入依赖的package包/类
private void setSourceBlock(BlockCoord bc) {
Block blockToSet = block;
int metaToSet = 0;
final World world = owner.getWorldObj();
switch (type) {
case CLASSIC:
metaToSet = ((BlockFluidClassic) block).getMaxRenderHeightMeta();
break;
case FINITE:
metaToSet = ((BlockFluidFinite) block).getMaxRenderHeightMeta();
break;
case VANILLA:
if (world.provider.isHellWorld && fluid == FluidRegistry.WATER && !niardAllowWaterInHell.getBoolean()) {
world.playSoundEffect(bc.x + 0.5F, bc.y + 0.1F, bc.z + 0.5F, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
for (int l = 0; l < 8; ++l) {
spawnParticle(world, "largesmoke", bc.x - 1 + 3 * Math.random(), bc.y + Math.random(), bc.z - 1 + 3 * Math.random(), 0.0D, 0.0D, 0.0D);
}
setVerticalBlock(bc, false);
return;
}
metaToSet = 0;
break;
}
world.setBlock(bc.x, bc.y, bc.z, blockToSet, metaToSet, 3);
}
示例3: FluidHelper
import net.minecraftforge.fluids.BlockFluidFinite; //导入依赖的package包/类
private FluidHelper(@Nonnull World world, @Nonnull FluidStack stack, @Nullable BlockCoord startbc) throws Exception {
this.world = world;
this.stack = stack;
this.fluid = notnullF(stack.getFluid(), "FluidStack.getFluid()");
this.block = notnull(fluid.getBlock(), "Invalid Fluid (it has no source block)");
this.downflowDirection = fluid.getDensity() > 0 ? ForgeDirection.DOWN : ForgeDirection.UP;
this.upflowDirection = downflowDirection == ForgeDirection.UP ? ForgeDirection.DOWN : ForgeDirection.UP;
if (this.block instanceof BlockFluidClassic) {
this.type = FluidType.CLASSIC;
} else if (this.block instanceof BlockFluidFinite) {
this.type = FluidType.FINITE;
} else if (this.block instanceof BlockLiquid) {
this.type = FluidType.VANILLA;
} else {
throw new Exception();
}
this.startbc = startbc;
}
示例4: isSourceBlock
import net.minecraftforge.fluids.BlockFluidFinite; //导入依赖的package包/类
public static boolean isSourceBlock(@Nonnull World world, @Nonnull BlockCoord bc) {
if (!world.blockExists(bc.x, bc.y, bc.z)) {
return false;
}
Block block = bc.getBlock(world);
if (block instanceof BlockFluidClassic) {
return ((BlockFluidClassic) block).isSourceBlock(world, bc.x, bc.y, bc.z);
} else if (block instanceof BlockFluidFinite) {
return ((BlockFluidFinite)block).canDrain(world, bc.x, bc.y, bc.z);
} else if (block instanceof BlockLiquid) {
return world.getBlockMetadata(bc.x, bc.y, bc.z) == 0;
} else {
return false;
}
}
示例5: makeBlock
import net.minecraftforge.fluids.BlockFluidFinite; //导入依赖的package包/类
public BlockFluidBase makeBlock(){
return new BlockFluidFinite(this, Material.water);
}