net.minecraft.world.World.isSidePowered()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中net.minecraft.world.World.isSidePowered()方法的一些代码示例,展示了World.isSidePowered()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.isSidePowered()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:isSidePowered

World.isSidePowered介绍

暂无

代码示例

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public boolean isSidePowered(@Nonnull BlockPos pos, @Nonnull EnumFacing side) {
 return wrapped.isSidePowered(pos, side);
}

代码示例来源:origin: amadornes/MCMultiPart

@Override
public boolean isSidePowered(BlockPos pos, EnumFacing side) {
  return getActualWorld().isSidePowered(pos, side);
}

代码示例来源:origin: CyclopsMC/IntegratedDynamics

@SuppressWarnings("deprecation")
@Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block neighborBlock, BlockPos fromPos) {
  super.neighborChanged(state, worldIn, pos, neighborBlock, fromPos);
  if(!worldIn.isRemote) {
    for (EnumFacing enumfacing : EnumFacing.values()) {
      if (worldIn.isSidePowered(pos.offset(enumfacing), enumfacing)) {
        worldIn.setBlockState(pos, state.withProperty(HEIGHT, 1));
        for(Entity entity : worldIn.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)))) {
          entity.motionY += 0.25F;
          entity.posY += 0.5F;
        }
        return;
      }
    }
  }
}

代码示例来源:origin: CoFH/ThermalDynamics

@Override
public void onNeighborBlockChange() {
  super.onNeighborBlockChange();
  if (ServerHelper.isClientWorld(world())) {
    return;
  }
  lit = false;
  EnumFacing[] valid_directions = EnumFacing.VALUES;
  for (int i = 0; !lit && i < valid_directions.length; i++) {
    Attachment attachment = parent.getAttachment(i);
    if (attachment != null && attachment.shouldRSConnect()) {
      continue;
    }
    EnumFacing dir = valid_directions[i];
    lit = world().isSidePowered(pos().offset(dir), dir);
  }
  if (grid != null && grid.lit != lit) {
    grid.upToDate = false;
  }
}

相关文章

微信公众号

最新文章

更多

World类方法