本文整理汇总了Java中net.minecraft.block.state.IBlockState.hasComparatorInputOverride方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockState.hasComparatorInputOverride方法的具体用法?Java IBlockState.hasComparatorInputOverride怎么用?Java IBlockState.hasComparatorInputOverride使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.state.IBlockState
的用法示例。
在下文中一共展示了IBlockState.hasComparatorInputOverride方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isBasicBlock
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean isBasicBlock(IBlockAccess w, BlockPos p, IBlockState s) {
int stateId = Block.getStateId(s);
if (basicBlocks.contains(stateId)) {
return true;
}
if (nonBasicBlocks.contains(stateId)) {
return false;
}
boolean result = !s.getBlock().hasTileEntity(s) && !s.canProvidePower() && !s.hasComparatorInputOverride()
&& s.getProperties().entrySet().stream().allMatch(e -> allowedProperty(e.getKey()));
if (result) {
basicBlocks.add(stateId);
} else {
nonBasicBlocks.add(stateId);
}
return result;
}
示例2: markAndNotifyBlock
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void markAndNotifyBlock(BlockPos pos, Chunk chunk, IBlockState iblockstate, IBlockState newState, int flags)
{
{
{
if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && (chunk == null || chunk.isPopulated()))
{
this.notifyBlockUpdate(pos, iblockstate, newState, flags);
}
if (!this.isRemote && (flags & 1) != 0)
{
this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock());
if (newState.hasComparatorInputOverride())
{
this.updateComparatorOutputLevel(pos, newState.getBlock());
}
}
}
}
}
示例3: getRedstoneValue
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Override
public int getRedstoneValue(World world, BlockPos pos, int sensorRange, String textBoxText, Set<BlockPos> positions) {
int maxStrength = 0;
for (BlockPos p : positions) {
IBlockState state = world.getBlockState(p);
if (state.hasComparatorInputOverride()) {
maxStrength = Math.max(maxStrength, state.getComparatorInputOverride(world, p));
}
}
return maxStrength;
}
示例4: calculateInputStrength
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
protected int calculateInputStrength(World worldIn, BlockPos pos, IBlockState state)
{
int i = super.calculateInputStrength(worldIn, pos, state);
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
BlockPos blockpos = pos.offset(enumfacing);
IBlockState iblockstate = worldIn.getBlockState(blockpos);
if (iblockstate.hasComparatorInputOverride())
{
i = iblockstate.getComparatorInputOverride(worldIn, blockpos);
}
else if (i < 15 && iblockstate.isNormalCube())
{
blockpos = blockpos.offset(enumfacing);
iblockstate = worldIn.getBlockState(blockpos);
if (iblockstate.hasComparatorInputOverride())
{
i = iblockstate.getComparatorInputOverride(worldIn, blockpos);
}
else if (iblockstate.getMaterial() == Material.AIR)
{
EntityItemFrame entityitemframe = this.findItemFrame(worldIn, enumfacing, blockpos);
if (entityitemframe != null)
{
i = entityitemframe.getAnalogOutput();
}
}
}
return i;
}
示例5: setBlockState
import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
* Sets the block state at a given location. Flag 1 will cause a block update. Flag 2 will send the change to
* clients (you almost always want this). Flag 4 prevents the block from being re-rendered, if this is a client
* world. Flags can be added together.
*/
public boolean setBlockState(BlockPos pos, IBlockState newState, int flags)
{
if (this.isOutsideBuildHeight(pos))
{
return false;
}
else if (!this.isRemote && this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD)
{
return false;
}
else
{
Chunk chunk = this.getChunkFromBlockCoords(pos);
Block block = newState.getBlock();
IBlockState iblockstate = chunk.setBlockState(pos, newState);
if (iblockstate == null)
{
return false;
}
else
{
if (newState.getLightOpacity() != iblockstate.getLightOpacity() || newState.getLightValue() != iblockstate.getLightValue())
{
this.theProfiler.startSection("checkLight");
this.checkLight(pos);
this.theProfiler.endSection();
}
if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && chunk.isPopulated())
{
this.notifyBlockUpdate(pos, iblockstate, newState, flags);
}
if (!this.isRemote && (flags & 1) != 0)
{
this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock(), true);
if (newState.hasComparatorInputOverride())
{
this.updateComparatorOutputLevel(pos, block);
}
}
else if (!this.isRemote && (flags & 16) == 0)
{
this.func_190522_c(pos, block);
}
return true;
}
}
}