本文整理汇总了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();
}
}
示例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();
}
}