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


Java Material.PORTAL属性代码示例

本文整理汇总了Java中net.minecraft.block.material.Material.PORTAL属性的典型用法代码示例。如果您正苦于以下问题:Java Material.PORTAL属性的具体用法?Java Material.PORTAL怎么用?Java Material.PORTAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.block.material.Material的用法示例。


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

示例1: blockRamen

public blockRamen() {
	
	super(Material.PORTAL);
	
	setUnlocalizedName(Reference.RTAPBlocks.BLOCKRAMEN.getUnlocalizedName());
	setRegistryName(Reference.RTAPBlocks.BLOCKRAMEN.getRegistryName());
	setCreativeTab(Reference.tabRTAP);
	setHardness(1F);
	setResistance(1.5F);
	setSoundType(SoundType.SLIME);
	
}
 
开发者ID:Bedrockbreaker,项目名称:rtap,代码行数:12,代码来源:blockRamen.java

示例2: blockJello

public blockJello() {
	
	super(Material.PORTAL);
	
	setUnlocalizedName(Reference.RTAPBlocks.BLOCKJELLO.getUnlocalizedName());
	setRegistryName(Reference.RTAPBlocks.BLOCKJELLO.getRegistryName());
	setCreativeTab(Reference.tabRTAP);
	setHardness(0F);
	setResistance(0F);
	setLightOpacity(5);
	setSoundType(SoundType.SLIME);
	
}
 
开发者ID:Bedrockbreaker,项目名称:rtap,代码行数:13,代码来源:blockJello.java

示例3: canDisplace

/**
 * Returns true if the block at (pos) is displaceable. Does not displace the block.
 */
public boolean canDisplace(IBlockAccess world, BlockPos pos)
{
    if (world.isAirBlock(pos)) return true;

    IBlockState state = world.getBlockState(pos);

    if (state.getBlock() == this)
    {
        return false;
    }

    if (displacements.containsKey(state.getBlock()))
    {
        return displacements.get(state.getBlock());
    }

    Material material = state.getMaterial();
    if (material.blocksMovement() || material == Material.PORTAL)
    {
        return false;
    }

    int density = getDensity(world, pos);
    if (density == Integer.MAX_VALUE)
    {
        return true;
    }

    if (this.density > density)
    {
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:40,代码来源:BlockFluidBase.java

示例4: canFlowInto

protected boolean canFlowInto(IBlockAccess world, BlockPos pos)
{
    if (world.isAirBlock(pos)) return true;

    IBlockState state = world.getBlockState(pos);
    if (state.getBlock() == this)
    {
        return true;
    }

    if (displacements.containsKey(state.getBlock()))
    {
        return displacements.get(state.getBlock());
    }

    Material material = state.getMaterial();
    if (material.blocksMovement()  ||
        material == Material.WATER ||
        material == Material.LAVA  ||
        material == Material.PORTAL)
    {
        return false;
    }

    int density = getDensity(world, pos);
    if (density == Integer.MAX_VALUE)
    {
         return true;
    }

    if (this.density > density)
    {
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:39,代码来源:BlockFluidClassic.java

示例5: BlockPortal

public BlockPortal()
{
    super(Material.PORTAL, false);
    this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.X));
    this.setTickRandomly(true);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:BlockPortal.java

示例6: isBlocked

private boolean isBlocked(World worldIn, BlockPos pos, IBlockState state)
{
    Block block = worldIn.getBlockState(pos).getBlock();
    return !(block instanceof BlockDoor) && block != Blocks.STANDING_SIGN && block != Blocks.LADDER && block != Blocks.REEDS ? (block.blockMaterial != Material.PORTAL && block.blockMaterial != Material.STRUCTURE_VOID ? block.blockMaterial.blocksMovement() : true) : true;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:BlockDynamicLiquid.java

示例7: displaceIfPossible

/**
 * Attempt to displace the block at (pos), return true if it was displaced.
 */
public boolean displaceIfPossible(World world, BlockPos pos)
{
    if (world.isAirBlock(pos))
    {
        return true;
    }

    IBlockState state = world.getBlockState(pos);
    Block block = state.getBlock();
    if (block == this)
    {
        return false;
    }

    if (displacements.containsKey(block))
    {
        if (displacements.get(block))
        {
            if (state.getBlock() != Blocks.SNOW_LAYER) //Forge: Vanilla has a 'bug' where snowballs don't drop like every other block. So special case because ewww...
                block.dropBlockAsItem(world, pos, state, 0);
            return true;
        }
        return false;
    }

    Material material = state.getMaterial();
    if (material.blocksMovement() || material == Material.PORTAL)
    {
        return false;
    }

    int density = getDensity(world, pos);
    if (density == Integer.MAX_VALUE)
    {
        block.dropBlockAsItem(world, pos, state, 0);
        return true;
    }

    if (this.density > density)
    {
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:50,代码来源:BlockFluidBase.java


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