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


Java BlockRedstoneDiode.isDiode方法代码示例

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


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

示例1: onValidSurface

import net.minecraft.block.BlockRedstoneDiode; //导入方法依赖的package包/类
/**
 * checks to make sure painting can be placed there
 */
public boolean onValidSurface()
{
    if (!this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty())
    {
        return false;
    }
    else
    {
        int i = Math.max(1, this.getWidthPixels() / 16);
        int j = Math.max(1, this.getHeightPixels() / 16);
        BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite());
        EnumFacing enumfacing = this.facingDirection.rotateYCCW();
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

        for (int k = 0; k < i; ++k)
        {
            for (int l = 0; l < j; ++l)
            {
                int i1 = (i - 1) / -2;
                int j1 = (j - 1) / -2;
                blockpos$mutableblockpos.setPos(blockpos).move(enumfacing, k + i1).move(EnumFacing.UP, l + j1);
                IBlockState iblockstate = this.world.getBlockState(blockpos$mutableblockpos);

                if (!iblockstate.getMaterial().isSolid() && !BlockRedstoneDiode.isDiode(iblockstate))
                {
                    return false;
                }
            }
        }

        return this.world.getEntitiesInAABBexcluding(this, this.getEntityBoundingBox(), IS_HANGING_ENTITY).isEmpty();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:EntityHanging.java

示例2: onValidSurface

import net.minecraft.block.BlockRedstoneDiode; //导入方法依赖的package包/类
/**
 * checks to make sure painting can be placed there
 */
public boolean onValidSurface()
{
    if (!this.worldObj.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty())
    {
        return false;
    }
    else
    {
        int i = Math.max(1, this.getWidthPixels() / 16);
        int j = Math.max(1, this.getHeightPixels() / 16);
        BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite());
        EnumFacing enumfacing = this.facingDirection.rotateYCCW();
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

        for (int k = 0; k < i; ++k)
        {
            for (int l = 0; l < j; ++l)
            {
                int i1 = (i - 1) / -2;
                int j1 = (j - 1) / -2;
                blockpos$mutableblockpos.setPos(blockpos).move(enumfacing, k + i1).move(EnumFacing.UP, l + j1);
                IBlockState iblockstate = this.worldObj.getBlockState(blockpos$mutableblockpos);

                if (iblockstate.isSideSolid(this.worldObj, blockpos$mutableblockpos, this.facingDirection))
                    continue;

                if (!iblockstate.getMaterial().isSolid() && !BlockRedstoneDiode.isDiode(iblockstate))
                {
                    return false;
                }
            }
        }

        return this.worldObj.getEntitiesInAABBexcluding(this, this.getEntityBoundingBox(), IS_HANGING_ENTITY).isEmpty();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:40,代码来源:EntityHanging.java


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